Class Heart
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.Heart
- All Implemented Interfaces:
Saveable<HeartMemento>
Heart collectable that heals the player.
-
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(HeartMemento 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
-
Heart
public Heart(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<HeartMemento>- 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<HeartMemento>- Parameters:
memento- The memento containing the state to restore
-