Class PlayerBoat
- java.lang.Object
-
- com.dragonboatrace.entities.Entity
-
- com.dragonboatrace.entities.boats.Boat
-
- com.dragonboatrace.entities.boats.PlayerBoat
-
public class PlayerBoat extends Boat
Represents a specific Player controlled Boat.
-
-
Field Summary
-
Fields inherited from class com.dragonboatrace.entities.boats.Boat
agility, boatType, buff, collisionTime, distanceTravelled, generator, health, healthFont, lane, laneBox, layout, maxStamina, name, nameFont, parameter, penaltyTime, recentCollision, speed, stamina, staminaFont, time, totalTime
-
-
Constructor Summary
Constructors Constructor Description PlayerBoat(BoatType boat, Lane lane, java.lang.String name)
Creates a player boat with values from boat, in Lane lane, and an identifying name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isDead()
If the player boat has no health left.void
render(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
Renders the players boat with the word "Player" at the top of the lane to indicate which lane is the players.void
update(float deltaTime)
Update the boats position in respects to the time passed since the last frame.void
updateYPosition(int lineHeight, int raceDistance)
Update the vertical position of the boat on-screen.-
Methods inherited from class com.dragonboatrace.entities.boats.Boat
addHealth, addSpeed, addStamina, checkCollisions, dispose, equals, getAgility, getBoatType, getBuff, getDistanceTravelled, getHealth, getLane, getName, getPenaltyTime, getSpeed, getStamina, getTime, getTotalTime, getVelocity, regenerateStamina, restore, save, setBuff, setTestTime, setTime, setTotalTime, useStamina, velocityPercentage
-
Methods inherited from class com.dragonboatrace.entities.Entity
getHitBox, getTexture, restore, save
-
-
-
-
Method Detail
-
update
public void update(float deltaTime)
Update the boats position in respects to the time passed since the last frame.
-
render
public void render(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)
Renders the players boat with the word "Player" at the top of the lane to indicate which lane is the players.
-
updateYPosition
public void updateYPosition(int lineHeight, int raceDistance)
Update the vertical position of the boat on-screen. Is related to the distance travelled in the race.- Overrides:
updateYPosition
in classBoat
- Parameters:
lineHeight
- The height of the finish line Entity.raceDistance
- The length of the race.
-
isDead
public boolean isDead()
If the player boat has no health left.- Returns:
- A boolean of if the boat is dead.
-
-