コード例 #1
0
ファイル: Game.cs プロジェクト: dahopkin/Invaders_Refactor
        } // end method MovePlayerShots

        /// <summary>
        /// This method moves the player in a certain direction.
        /// </summary>
        /// <param name="directionToMove">The direction you want the player to move.</param>
        public void MovePlayer(Direction directionToMove)
        {
            if (playerShip.Alive){
                if(!IsTouchingBorder(playerShip.Area, directionToMove, playerDistanceFromEdge))
                playerShip.Move(directionToMove);
            }
        } // end method MovePlayer
コード例 #2
0
ファイル: Game.cs プロジェクト: VaidasKrl/Invaders
 public void MovePlayer(Direction direction, bool gameOver)
 {
     if (!gameOver)
     {
         playerShip.Move(direction);
     }
 }
コード例 #3
0
 public void MovePlayer(Direction direction)
 {
     if (playerShip.Alive)
     {
         playerShip.Move(direction);
     }
 }
コード例 #4
0
        } // end method MovePlayerShots

        /// <summary>
        /// This method moves the player in a certain direction.
        /// </summary>
        /// <param name="directionToMove">The direction you want the player to move.</param>
        public void MovePlayer(Direction directionToMove)
        {
            if (playerShip.Alive)
            {
                if (!WillTouchBorder(playerShip.Area, directionToMove, 10))
                {
                    playerShip.Move(directionToMove);
                }
            }
        } // end method MovePlayer