Class InanimateTrigger
java.lang.Object
rekit.logic.gameelements.GameElement
rekit.logic.gameelements.inanimate.Inanimate
rekit.logic.gameelements.inanimate.InanimateTrigger
- All Implemented Interfaces:
Collidable
- Direct Known Subclasses:
EndTrigger
This is the default implementation of an inanimate trigger in the game.
-
Nested Class Summary
Nested classes/interfaces inherited from interface rekit.logic.Collidable
Collidable.Optional -
Field Summary
Fields inherited from class rekit.logic.gameelements.GameElement
deleteMe, deltaTime, team, visible -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreateTrigger(Vec pos, Vec size, Runnable onPerform) Utility function for easy use with lambdas.voidTemplate method that will be called periodically after being added to aIScene.voidperform()Perform trigger-action.final voidreactToCollision(GameElement element, Direction dir) Notification that this GameElement has been collided with from another GameElement element from the given direction dir.Methods inherited from class rekit.logic.gameelements.inanimate.Inanimate
collidedWithSolid, create, getLives, getPrototypeMethods inherited from class rekit.logic.gameelements.GameElement
checkCollision, destroy, getDeleteMe, getFrame, getPos, getScene, getSize, getTeam, getVel, getZ, getZHint, init, isAddableToGroup, isVisible, killBoost, logicLoop, render, setPos, setScene, setSize, setVelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface rekit.logic.Collidable
addDamage
-
Constructor Details
-
InanimateTrigger
Create the trigger.- Parameters:
pos- the positionsize- the size
-
-
Method Details
-
createTrigger
Utility function for easy use with lambdas.- Parameters:
pos- the positionsize- the sizeonPerform-perform()
-
internalRender
Description copied from class:GameElementTemplate method that will be called periodically after being added to a
IScene. Must be as performant as possible to keep the FPS low, since it will be called in every render-loop.Should be overwritten in sub classes for custom visualization using the
GameGrid.- Overrides:
internalRenderin classInanimate- Parameters:
f- theGameGridthat represents the games field and supplies primitive drawing operations.
-
reactToCollision
Description copied from interface:CollidableNotification that this GameElement has been collided with from another GameElement element from the given direction dir.
Can be overwritten for defining an optional reaction that the GameElement performs on the other GameElement and/or itself upon collision.
- Specified by:
reactToCollisionin interfaceCollidable- Overrides:
reactToCollisionin classInanimate- Parameters:
element- the GameElement that collided with this GameElementdir- the Direction this GameElement has been collided from.
-
perform
public void perform()Perform trigger-action.
-