Package com.csse3200.game.components
Class RicochetComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.RicochetComponent
Ricochet based on target layers.
A bouncing effect that continues to bounce off desired entities.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRicochetComponent
(short targetLayer, int bounceCount) Initialise a RicochetComponent that spawns another projectile upon collision. -
Method Summary
Modifier and TypeMethodDescriptionvoid
create()
Called when the entity is created and registered.Methods inherited from class com.csse3200.game.components.Component
dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
RicochetComponent
public RicochetComponent(short targetLayer, int bounceCount) Initialise a RicochetComponent that spawns another projectile upon collision. Projectile has a chance to head upwards or downwards and upon spawning, it will be slighlty up or down in respect to original disappearance.- Parameters:
targetLayer
- Target layer upon collisionbounceCount
- Keeps track of the bounce count upon initial collision Stops self-spawning when bounce count is greater or equal than two.
-
-
Method Details