Example #1
0
 private void gameTimer_Tick(object sender, EventArgs e)
 {
     game.Go();
     foreach (Keys key in keysPressed)
     {
         if (key == Keys.Left)
         {
             game.MovePlayer(Direction.Left, gameOver);
             return;
         }
         else if (key == Keys.Right)
         {
             game.MovePlayer(Direction.Right, gameOver);
             return;
         }
     }
 }
Example #2
0
        } // end method Form1_KeyUp

        private void gameTimer_Tick(object sender, EventArgs e)
        {
            game.Go();

            foreach (Keys key in keysPressed)
            {
                if (key == Keys.Left)
                {
                    game.MovePlayer(Direction.Left);
                    return;
                } // end if

                else if (key == Keys.Right)
                {
                    game.MovePlayer(Direction.Right);
                    return;
                } // end else if
            }     // end foreach
        }         // end method gameTimer_Tick