示例#1
0
        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);
            }
        }
示例#2
0
 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);
 }
示例#3
0
        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);
        }