Class Bird
java.lang.Object
com.csse3200.game.minigames.birdiedash.entities.Bird
Class for the bird in the mini-game birdie dash
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDetermines if the bird is fallingvoid
flap()
Flag to move birdfloat
Gets the birds heightcom.badlogic.gdx.math.Rectangle
Returns the birds bounding boxcom.badlogic.gdx.math.Vector2
Returns the birds positioncom.badlogic.gdx.math.Vector2
For Testingboolean
Used for testingboolean
For testingvoid
setCollidingBottomPipe
(float y) Method to set that the bird is colliding with the bottom of a pipevoid
For collisionsvoid
setCollidingTopPipe
(float y) Method to set that the bird is colliding with the top of a pipevoid
setPosition
(float x, float y) Used for testingvoid
setVelocity
(float x, float y) For testingDetermines if the bird is touching or past the groundvoid
For collisions.void
Method to unset the bird is colliding with a pipevoid
update
(float deltaTime, float multiplier) Updates the birds position and adjusts velocity as needed
-
Constructor Details
-
Bird
public Bird(float x, float y)
-
-
Method Details
-
update
public void update(float deltaTime, float multiplier) Updates the birds position and adjusts velocity as needed- Parameters:
deltaTime
- the time from the last position updatemultiplier
- Used to speed up the game
-
setCollidingTopPipe
public void setCollidingTopPipe(float y) Method to set that the bird is colliding with the top of a pipe- Parameters:
y
- the y position
-
isCollideTopOfPipe
public boolean isCollideTopOfPipe()Used for testing -
unsetCollidingTopPipe
public void unsetCollidingTopPipe()Method to unset the bird is colliding with a pipe -
setCollidingBottomPipe
public void setCollidingBottomPipe(float y) Method to set that the bird is colliding with the bottom of a pipe- Parameters:
y
- the y position
-
setCollidingPipe
public void setCollidingPipe()For collisions -
isCollidingPipe
public boolean isCollidingPipe()For testing -
getBirdHeight
public float getBirdHeight()Gets the birds height- Returns:
- the birds height
-
unsetCollidingPipe
public void unsetCollidingPipe()For collisions. -
flap
public void flap()Flag to move bird -
getPosition
public com.badlogic.gdx.math.Vector2 getPosition()Returns the birds position- Returns:
- the birds position
-
getBoundingBox
public com.badlogic.gdx.math.Rectangle getBoundingBox()Returns the birds bounding box- Returns:
- the birds bounding box
-
touchingFloor
Determines if the bird is touching or past the ground- Returns:
- true if bird it touching the ground, otherwise false
-
setPosition
public void setPosition(float x, float y) Used for testing -
setVelocity
public void setVelocity(float x, float y) For testing -
getVelocity
public com.badlogic.gdx.math.Vector2 getVelocity()For Testing- Returns:
- The velocity vector
-
birdFalling
Determines if the bird is falling- Returns:
- isFalling
-