Class RicochetComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.RicochetComponent

public class RicochetComponent extends Component
Ricochet based on target layers. A bouncing effect that continues to bounce off desired entities.
  • 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 collision
      bounceCount - Keeps track of the bounce count upon initial collision Stops self-spawning when bounce count is greater or equal than two.
  • Method Details

    • create

      public void create()
      Description copied from class: Component
      Called when the entity is created and registered. Initial logic such as calls to GetComponent should be made here, not in the constructor which is called before an entity is finished.
      Overrides:
      create in class Component