Package com.mygdx.game.Entitys
Class CannonBallCollege
- java.lang.Object
-
- com.mygdx.game.Entitys.Entity
-
- com.mygdx.game.Entitys.CannonBallCollege
-
- All Implemented Interfaces:
CollisionCallBack
public class CannonBallCollege extends Entity implements CollisionCallBack
NEW CLASS Cannonball entity and the methods to get it flying.
-
-
Constructor Summary
Constructors Constructor Description CannonBallCollege()
-
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)Called on the object that enters the triggervoidExitTrigger(CollisionInfo info)Called upon exiting a triggervoidfire(com.badlogic.gdx.math.Vector2 pos, com.badlogic.gdx.math.Vector2 dir, College sender)Teleport the cannonball in from offscreen and set in flying away from the ship.CollegegetShooter()voidkill()Marks cannonball for removal on next update.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
-
update
public void update()
Description copied from class:EntitySimilar to the Component's update event
-
fire
public void fire(com.badlogic.gdx.math.Vector2 pos, com.badlogic.gdx.math.Vector2 dir, College sender)Teleport the cannonball in from offscreen and set in flying away from the ship.- Parameters:
pos- 2D vector location from where it sets offdir- 2D vector direction for its movementsender- ship entity firing it
-
kill
public void kill()
Marks cannonball for removal on next update.
-
getShooter
public College getShooter()
-
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)
Description copied from interface:CollisionCallBackCalled on the object that enters the trigger- Specified by:
EnterTriggerin interfaceCollisionCallBack
-
ExitTrigger
public void ExitTrigger(CollisionInfo info)
Description copied from interface:CollisionCallBackCalled upon exiting a trigger- Specified by:
ExitTriggerin interfaceCollisionCallBack
-
-