Esempio n. 1
0
        public override void Update(float dt)
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Space) && !hit)
            {
                dungeon.Generate(9, 6);
                hit = true;
            }
            if (Keyboard.GetState().IsKeyUp(Keys.Space) && hit)
            {
                hit = false;
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Up))
            {
                camera.Y -= camera.Speed;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Down))
            {
                camera.Y += camera.Speed;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Left))
            {
                camera.X -= camera.Speed;
            }
            if (Keyboard.GetState().IsKeyDown(Keys.Right))
            {
                camera.X += camera.Speed;
            }
        }
Esempio n. 2
0
 // Start is called before the first frame update
 void Start()
 {
     StateMachine = GetComponent <StateMachine>();
     Map.Generate(100, 100);
     // set the camera to follow the player
     GameController.Instance.Cinemachine.Follow = Map.Player.transform;
     StateMachine.ChangeState <PlayerTurnDungeonState>();
     Iterator = CreateActorTurnEnumerable().GetEnumerator();
 }
Esempio n. 3
0
        internal override void Load()
        {
            // Dungeon
            dungeon = new DungeonMap();
            dungeon.Generate(9, 6);
            minimap            = new DungeonMinimap();
            minimap.DungeonMap = dungeon;

            // Camera
            camera = new Camera();
        }