Class Key
java.lang.Object
de.tum.cit.ase.maze.objects.GameElement
de.tum.cit.ase.maze.objects.still.collectable.Collectable
de.tum.cit.ase.maze.objects.still.Key
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
Represents a Key collectable object in the game.
This class extends the Collectable class.
-
Field Summary
Fields inherited from class de.tum.cit.ase.maze.objects.still.collectable.Collectable
active, frameHeight, frameWidth, light, rayHandler, removable, textureAtlas, textureRegion, ZOOM
Fields inherited from class de.tum.cit.ase.maze.objects.GameElement
body, texture, world
-
Constructor Summary
ConstructorDescriptionKey
(com.badlogic.gdx.math.Vector2 position, com.badlogic.gdx.physics.box2d.World world, box2dLight.RayHandler rayHandler, com.badlogic.gdx.graphics.g2d.TextureAtlas textureAtlas) Represents a Key collectable object in the game. -
Method Summary
Methods inherited from class de.tum.cit.ase.maze.objects.still.collectable.Collectable
createBoy, dispose, isActive, isRemovable, remove, update
-
Constructor Details
-
Key
public Key(com.badlogic.gdx.math.Vector2 position, com.badlogic.gdx.physics.box2d.World world, box2dLight.RayHandler rayHandler, com.badlogic.gdx.graphics.g2d.TextureAtlas textureAtlas) Represents a Key collectable object in the game. This class extends the Collectable class.
-
-
Method Details
-
render
public void render(com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch) Description copied from class:GameElement
Renders the appearance of the game object- Specified by:
render
in classGameElement
-
collect
Collects the key from the player and updates the state of the key.- Specified by:
collect
in classCollectable
- Parameters:
player
- the player object that collects the key
-