Class Player


  • public class Player
    extends Boat
    Represents the player's boat.
    • Constructor Detail

      • Player

        public Player​(int yPosition,
                      int width,
                      int height,
                      Lane[] lanes,
                      int laneNo,
                      java.lang.String name)
        Creates an instance of the player boat.
        Parameters:
        yPosition - Y-position of the boat.
        width - Width of the boat.
        height - Height of the boat.
        lanes - Lanes for the boat.
        laneNo - Lane number for the boat.
        name - Name of the boat.
    • Method Detail

      • GetInput

        public void GetInput()
        Moves the player based on key pressed (W, A, S, D).