Exemple #1
0
 public static void HumanPlayer(FootballPlayer player)
 {
     if (Globals.keyboard.GetPress("W"))
     {
         player.pos    = player.move(player.pos);
         player.pos    = player.move(player.pos);
         player.moving = true;
     }
     else
     {
         player.moving = false;
     }
     if (Globals.keyboard.GetPress("A"))
     {
         player.AddDirection(-2);
     }
     if (Globals.keyboard.GetPress("S"))
     {
         player.pos = player.move(player.pos);
     }
     if (Globals.keyboard.GetPress("D"))
     {
         player.AddDirection(2);
     }
     if (Globals.keyboard.GetPress("Space"))
     {
         player.Shoot(player);
     }
 }