Class InanimateFloor
java.lang.Object
rekit.logic.gameelements.GameElement
rekit.logic.gameelements.inanimate.Inanimate
rekit.logic.gameelements.inanimate.InanimateFloor
- All Implemented Interfaces:
Collidable
The standard Inanimate that will be used for the lowest height in the level.
By mechanics, it does not differ from the
InanimateBox
but is instead
designed to resemble grass.- Author:
- Angelo Aracri
-
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
ConstructorsModifierConstructorDescriptionprotected
InanimateFloor
(Vec pos, Vec size) Standard constructor that requires position and size of theInanimateFloor
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Template method that will be called periodically after being added to aIScene
.void
reactToCollision
(GameElement element, Direction dir) Notification that this GameElement has been collided with from another GameElement element from the given direction dir.static Inanimate
staticCreate
(Vec pos) Static create method that will be used byInanimate
for it in order to decide betweenInanimateFloor
andInanimateBox
.Methods inherited from class rekit.logic.gameelements.inanimate.Inanimate
collidedWithSolid, create, getLives, getPrototype
Methods 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, setVel
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface rekit.logic.Collidable
addDamage
-
Constructor Details
-
InanimateFloor
Standard constructor that requires position and size of the
InanimateFloor
.Also, it creates the
GrassStraws
that will be rendered on top of theInanimateFloor
.- Parameters:
pos
- the position of theInanimateFloor
.size
- the size of theInanimateFloor
.
-
-
Method Details
-
internalRender
Description copied from class:GameElement
Template 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:
internalRender
in classInanimate
- Parameters:
f
- theGameGrid
that represents the games field and supplies primitive drawing operations.
-
reactToCollision
Description copied from interface:Collidable
Notification 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:
reactToCollision
in interfaceCollidable
- Overrides:
reactToCollision
in classInanimate
- Parameters:
element
- the GameElement that collided with this GameElementdir
- the Direction this GameElement has been collided from.
-
staticCreate
Static create method that will be used byInanimate
for it in order to decide betweenInanimateFloor
andInanimateBox
.- Parameters:
pos
- the position to create theInanimateFloor
to.- Returns:
- the newly created
InanimateFloor
.
-