Ejemplo n.º 1
0
        private void timer_Tick(object sender, EventArgs e)
        {
            switch (game.GetState())
            {
            case Game.GameState.Waiting:
                GrowStick();
                break;

            case Game.GameState.StickFalling:
                DropStick();
                break;

            case Game.GameState.HeroMoving:
                MoveHero();
                break;

            case Game.GameState.BoardMoving:
                game.MoveBoard();
                break;

            case Game.GameState.HeroFalling:
                DropHero();
                break;
            }
            PlayingBoardPictureBox.Refresh();
        }
Ejemplo n.º 2
0
        public GameForm()
        {
            InitializeComponent();
            SetElementsParameters();
            game.Start();

            timer.Interval = 1;
            game.Restart();
            timer.Start();
            PlayingBoardPictureBox.Refresh();
        }