public World(int SaveIndex = -1) { if(SaveIndex != -1) { WorldObj = new WorldObjects(this); WorldObj.WorldIndex = SaveIndex; WorldObj.LoadWorld(); WorldObj.GenerateInitialLightmap(); } else { WorldObj = new WorldObjects(this); WorldObj.GenerateFlatlands(); WorldObj.GenerateInitialLightmap(); } entities = new List<Entity>(); if(players == null || GetClientPlayer() == null) { players = new List<Player>(); Player p = new Player(); p.Position = new Vector2(50 * 32, 50 * 32); p.IsClientPlayer = true; p.Username = MainGame.GameOptions.Username; players.Add(p); } }
public Player GetClientPlayer() { if(players == null) { players = new List<Player>(); Player p = new Player(); p.IsClientPlayer = true; p.Username = MainGame.GameOptions.Username; players.Add(p); } return players.Find(x => x.IsClientPlayer); }
public void Draw(GameTime gameTime) { if(players == null) { players = new List<Player>(); Player p = new Player(); p.IsClientPlayer = true; p.Username = MainGame.GameOptions.Username; players.Add(p); } if(players.Count == 0) { Player p = new Player(); p.IsClientPlayer = true; p.Username = MainGame.GameOptions.Username; players.Add(p); } DrawTiles(gameTime); DrawEntities(gameTime); }