Class Pipe
java.lang.Object
com.csse3200.game.minigames.birdiedash.entities.Pipe
Class for the pipes in birdie dash mini-game
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
changePosition
(float dt) chane the pipes position (as the screen moves along)com.badlogic.gdx.math.Rectangle
Get the bottom pipefloat
Get the bottom pipes heightfloat
Get the top pipes heightcom.badlogic.gdx.math.Vector2
Get the bottom pipe positioncom.badlogic.gdx.math.Vector2
Get the top pipe positioncom.badlogic.gdx.math.Rectangle
Get the top pipefloat
getWidth()
Get the pipes widthvoid
spawns a pipevoid
setPosition
(float x) Method for testing
-
Constructor Details
-
Pipe
public Pipe(float start, float startSpeed)
-
-
Method Details
-
changePosition
public void changePosition(float dt) chane the pipes position (as the screen moves along)- Parameters:
dt
- the time since it last changed
-
respawnPipe
public void respawnPipe()spawns a pipe -
getPositionBottom
public com.badlogic.gdx.math.Vector2 getPositionBottom()Get the bottom pipe position- Returns:
- the bottom pipe position
-
getPositionTop
public com.badlogic.gdx.math.Vector2 getPositionTop()Get the top pipe position- Returns:
- the top pipe position
-
getWidth
public float getWidth()Get the pipes width- Returns:
- the pipe width
-
getHeightBottom
public float getHeightBottom()Get the bottom pipes height- Returns:
- the pipe height
-
getHeightTop
public float getHeightTop()Get the top pipes height- Returns:
- the pipe height
-
getBottomPipe
public com.badlogic.gdx.math.Rectangle getBottomPipe()Get the bottom pipe- Returns:
- the bottom pipe
-
getTopPipe
public com.badlogic.gdx.math.Rectangle getTopPipe()Get the top pipe- Returns:
- the top pipe
-
setPosition
public void setPosition(float x) Method for testing
-