Class Player


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

      • Player

        public Player​(int yPosition,
                      int width,
                      int height,
                      Lane lane,
                      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.
        lane - Lane 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).
      • ChooseBoat

        public void ChooseBoat​(int boatNo)

        Assigns the selected boat template to the boat.

        This includes stats and texture.

        Parameters:
        boatNo - Number of the boat template selected.