Exemplo n.º 1
0
        public bool MovePlayer(Player player, DungeonMap dungeonMap, RLKey key)
        {
            Game.time++;

            x = player.X;
            y = player.Y;

            switch (key)
            {
            case RLKey.Up:
            {
                y -= 1;
                break;
            }

            case RLKey.Down:
            {
                y += 1;
                break;
            }

            case RLKey.Left:
            {
                x -= 1;
                break;
            }

            case RLKey.Right:
            {
                x += 1;
                break;
            }

            default: return(false);
            }



            return(dungeonMap.SetActorPosition(ref player, x, y));
        }
Exemplo n.º 2
0
 public MapGenerator(int width, int heigth)
 {
     this.width  = width;
     this.heigth = heigth;
     map         = new DungeonMap();
 }