Beispiel #1
0
 protected Player updatePhysicsPlayer(Player player, int time)
 {
     if ((player.PlayerState & PlayerState.RotateRight) != 0)
     {
         player.RotateRight(time);
     }
     if ((player.PlayerState & PlayerState.RotateLeft) != 0)
     {
         player.RotateLeft(time);
     }
     if ((player.PlayerState & PlayerState.MoveFront) != 0 && !isWallCollision(player, time) &&
         !isPlayersCollision(player, time))
     {
         player.MoveFront(time);
     }
     if ((player.PlayerState & PlayerState.MoveBack) != 0)
     {
         if (!isBackWallCollision(player, time) && !isPlayersCollision(player, time))
         {
             player.MoveBack(time);
         }
     }
     return(player);
 }