Package com.dragonboatrace.entities
Class FinishLine
- java.lang.Object
-
- com.dragonboatrace.entities.Entity
-
- com.dragonboatrace.entities.FinishLine
-
public class FinishLine extends Entity
Represents the finish line of the race.
-
-
Constructor Summary
Constructors Constructor Description FinishLine(com.badlogic.gdx.math.Vector2 pos, int width)Creates a new Finish Line at a position and with a width which it will span.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrender(com.badlogic.gdx.graphics.g2d.SpriteBatch batch)Render the texture at the position and specified width.voidupdate(float playerPos, float raceDistance, float deltaTime, float velY)Update the position of the finish line so that it moves towards the player.
-
-
-
Method Detail
-
update
public void update(float playerPos, float raceDistance, float deltaTime, float velY)Update the position of the finish line so that it moves towards the player.- Parameters:
playerPos- The distance the player has travelled in the race.raceDistance- The total distance of the race.deltaTime- The time passed since the last frame.velY- The y-velocity of the entity it will move in respect to (Will be the player)
-
-