Class Key
java.lang.Object
de.tum.cit.fop.maze.objects.GameObject
de.tum.cit.fop.maze.objects.collectables.Collectable
de.tum.cit.fop.maze.objects.collectables.Key
- All Implemented Interfaces:
Saveable<KeyMemento>
Key collectable required to unlock the exit.
-
Field Summary
Fields inherited from class de.tum.cit.fop.maze.objects.GameObject
bounds, currentAnimationType, drawable, position, sizes, speed, speedMultiplier, spriteSizes, texture, velocity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a memento capturing the current state of this object.voidloadFromMemento(KeyMemento memento) Restores the object's state from a memento.protected voidMethods inherited from class de.tum.cit.fop.maze.objects.collectables.Collectable
animate, checkPlayerCollisionMethods inherited from class de.tum.cit.fop.maze.objects.GameObject
changeAnimation, entitiesOverlap, getBounds, getDrawable, getSize, getSpeed, getVelocity, increaseSpeed, move, multiplySpeed, nextPosition, setAnimationTime, updateAnimation
-
Constructor Details
-
Key
public Key(com.badlogic.gdx.math.Vector2 startpos)
-
-
Method Details
-
onPickUp
- Specified by:
onPickUpin classCollectable
-
getMemento
Description copied from interface:SaveableCreates a memento capturing the current state of this object.- Specified by:
getMementoin interfaceSaveable<KeyMemento>- Returns:
- A memento containing the object's state
-
loadFromMemento
Description copied from interface:SaveableRestores the object's state from a memento.- Specified by:
loadFromMementoin interfaceSaveable<KeyMemento>- Parameters:
memento- The memento containing the state to restore
-