Package controller
Class MineController
java.lang.Object
controller.ObjectController
controller.MineController
Stops GameObject movement at bottom of level and let it 'fly' in x-direction towards ego object.
If the object flies outside of the level (by x-coordinate) it is removed.
The behavior looks like a sinking sea mine, which stays at a certain depth and moves left/right to catch the player.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Fetches ego object by name 'ego' from current level and determines it's x-position.Methods inherited from class controller.ObjectController
applySpeedVector, getPlayground, getTimestep, getVX, getVY, getX, getY, setDummy, setObject, setPlayground, setVX, setVY, setX, setY
-
Constructor Details
-
MineController
public MineController(double lineSpeed)
-
-
Method Details
-
updateObject
public void updateObject()Fetches ego object by name 'ego' from current level and determines it's x-position. The controlled GameObject will move towards this position (in x-direction only). y-direction speed is reduced to zero, if the objects reached lower bound of level (high y-values). Only deletes the object if it flies out of visible game area.- Specified by:
updateObject
in classObjectController
-