Class Trap2
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.Trap2
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
This class represents a specific type of collectable called "Trap2". It extends the Collectable class and inherits its properties and behaviors.
-
Field Summary
Fields inherited from class de.tum.cit.ase.maze.objects.still.collectable.Collectable
active, frameHeight, frameWidth, light, rayHandler, removable, textureAtlas, ZOOMFields inherited from class de.tum.cit.ase.maze.objects.GameElement
body, texture, world -
Constructor Summary
ConstructorsConstructorDescriptionTrap2(com.badlogic.gdx.math.Vector2 position, com.badlogic.gdx.physics.box2d.World world, box2dLight.RayHandler rayHandler, com.badlogic.gdx.graphics.g2d.TextureAtlas textureAtlas) Constructs a Trap2 object. -
Method Summary
Methods inherited from class de.tum.cit.ase.maze.objects.still.collectable.Collectable
createBoy, dispose, isActive, isRemovable, remove, update
-
Constructor Details
-
Trap2
public Trap2(com.badlogic.gdx.math.Vector2 position, com.badlogic.gdx.physics.box2d.World world, box2dLight.RayHandler rayHandler, com.badlogic.gdx.graphics.g2d.TextureAtlas textureAtlas) Constructs a Trap2 object.- Parameters:
position- the position of the Trap2 objectworld- the world the Trap2 object belongs torayHandler- the rayHandler used for lightingtextureAtlas- the textureAtlas used to retrieve the sprite
-
-
Method Details
-
collect
Decreases the player's speed by 25%, and plays a sound effect.- Specified by:
collectin classCollectable- Parameters:
player- the player object to collect the trap2
-
render
public void render(com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch) Description copied from class:GameElementRenders the appearance of the game object- Specified by:
renderin classGameElement
-