Class Exit
java.lang.Object
de.tum.cit.ase.maze.objects.GameElement
de.tum.cit.ase.maze.objects.still.Exit
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
Defines the exit of the Game. Cant be passed BUT can end the game with a victory if the player Requests an opening and all steps to win are fulfilled like having all keys.
-
Field Summary
Fields inherited from class de.tum.cit.ase.maze.objects.GameElement
body, texture, world
-
Constructor Summary
ConstructorDescriptionExit
(com.badlogic.gdx.physics.box2d.World world, com.badlogic.gdx.math.Vector2 position, GameScreen game) -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes theTexture
;void
render
(com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch) Renders the Exitboolean
requestOpening
(Player player) Request opening of the exit.void
update
(float deltaTime) Updates the Object
-
Field Details
-
open
public boolean open
-
-
Constructor Details
-
Exit
public Exit(com.badlogic.gdx.physics.box2d.World world, com.badlogic.gdx.math.Vector2 position, GameScreen game)
-
-
Method Details
-
render
public void render(com.badlogic.gdx.graphics.g2d.SpriteBatch spriteBatch) Renders the Exit- Specified by:
render
in classGameElement
-
update
public void update(float deltaTime) Description copied from class:GameElement
Updates the Object- Specified by:
update
in classGameElement
- Parameters:
deltaTime
- Time since last frame.
-
requestOpening
Request opening of the exit. Opens the exit if the Player is eligible and marks Player as finished respectively.- Parameters:
player
-Player
that "requests" opening.- Returns:
- true if opening was granted
-
dispose
public void dispose()Disposes theTexture
;
-