Package com.dragonboat.game
Class Obstacle
- java.lang.Object
-
- com.dragonboat.game.Obstacle
-
-
Constructor Summary
Constructors Constructor Description Obstacle(int damage, int xPosition, int yPosition, int width, int height, com.badlogic.gdx.graphics.Texture texture)Creates an obstacle instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDamage()intgetHeight()com.badlogic.gdx.graphics.TexturegetTexture()floatgetX()floatgetY()voidMove(float moveVal, int backgroundOffset)Moves the obstacle.voidsetX(float xPosition)voidsetY(float yPosition)
-
-
-
Constructor Detail
-
Obstacle
public Obstacle(int damage, int xPosition, int yPosition, int width, int height, com.badlogic.gdx.graphics.Texture texture)Creates an obstacle instance.- Parameters:
damage- Damage the obstacle can inflict on a boat.xPosition- X-position.yPosition- Y-position.width- Width of the obstacle.height- Height of the obstacle.texture- Texture asset for the obstacle.
-
-
Method Detail
-
Move
public void Move(float moveVal, int backgroundOffset)Moves the obstacle.- Parameters:
moveVal- Distance to move the object by.backgroundOffset- Offset from screen to course coordinates.
-
getDamage
public int getDamage()
- Returns:
- Int representing damage the obstacle inflicts upon collision.
-
getX
public float getX()
- Returns:
- Float representing the x-position.
-
getY
public float getY()
- Returns:
- Float representing the y-position.
-
setY
public void setY(float yPosition)
- Parameters:
yPosition- Y-position.
-
setX
public void setX(float xPosition)
- Parameters:
xPosition- X-position.
-
getTexture
public com.badlogic.gdx.graphics.Texture getTexture()
- Returns:
- Texture asset for obstacle.
-
getHeight
public int getHeight()
- Returns:
- Int representing the height of the obstacle.
-
-