Package com.mygdx.game.Entitys
Class Monster
- java.lang.Object
-
- com.mygdx.game.Entitys.Entity
-
- com.mygdx.game.Entitys.Monster
-
- All Implemented Interfaces:
CollisionCallBack
public class Monster extends Entity implements CollisionCallBack
NEW Base class.
-
-
Field Summary
Fields Modifier and Type Field Description static com.badlogic.gdx.utils.ObjectMap<com.badlogic.gdx.math.Vector2,java.lang.String>directions
-
Constructor Summary
Constructors Constructor Description Monster()Creates a monster entity, containing Transform, Renderable, RigidBody, and Pirate components.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidBeginContact(CollisionInfo info)Called once a collision has being noticesvoidEndContact(CollisionInfo info)Called after the collision has being solvedvoidEnterTrigger(CollisionInfo info)if called on a Monster against anything else call it on the other thingvoidExitTrigger(CollisionInfo info)if called on a Monsteer against anything else call it on the other thingintgetHealth()com.badlogic.gdx.math.Vector2getPosition()booleanisAlive()voidMonsterDeath()voidsetDirection(com.badlogic.gdx.math.Vector2 dir)will rotate the monster to face the direction (just changes the sprite doesn't actually rotate)voidsetDirection(java.lang.String direction)will rotate the monster to face the direction (just changes the sprite doesn't actually rotate)voidsetHealth(int number)voidupdate()Similar to the Component's update event-
Methods inherited from class com.mygdx.game.Entitys.Entity
addComponent, addComponents, cleanUp, getComponent, getComponent, getComponents, getName, raiseEvents, setName
-
-
-
-
Method Detail
-
setDirection
public void setDirection(com.badlogic.gdx.math.Vector2 dir)
will rotate the monster to face the direction (just changes the sprite doesn't actually rotate)- Parameters:
dir- the dir to face (used to get the correct sprite )
-
setDirection
public void setDirection(java.lang.String direction)
will rotate the monster to face the direction (just changes the sprite doesn't actually rotate)- Parameters:
direction- the dir to face (used to get the correct sprite )
-
getPosition
public com.badlogic.gdx.math.Vector2 getPosition()
-
update
public void update()
Description copied from class:EntitySimilar to the Component's update event
-
getHealth
public int getHealth()
-
setHealth
public void setHealth(int number)
-
isAlive
public boolean isAlive()
-
MonsterDeath
public void MonsterDeath()
-
BeginContact
public void BeginContact(CollisionInfo info)
Description copied from interface:CollisionCallBackCalled once a collision has being notices- Specified by:
BeginContactin interfaceCollisionCallBack
-
EndContact
public void EndContact(CollisionInfo info)
Description copied from interface:CollisionCallBackCalled after the collision has being solved- Specified by:
EndContactin interfaceCollisionCallBack
-
EnterTrigger
public void EnterTrigger(CollisionInfo info)
if called on a Monster against anything else call it on the other thing- Specified by:
EnterTriggerin interfaceCollisionCallBack
-
ExitTrigger
public void ExitTrigger(CollisionInfo info)
if called on a Monsteer against anything else call it on the other thing- Specified by:
ExitTriggerin interfaceCollisionCallBack
-
-