Bandidos
Classes | Public Member Functions | Protected Member Functions | List of all members
com.mygdx.game.entities.weapons.projectiles.BaseProjectile Class Referenceabstract
Inheritance diagram for com.mygdx.game.entities.weapons.projectiles.BaseProjectile:
com.mygdx.game.engine.entities.BaseEntity com.mygdx.game.engine.events.IEventReceiver com.mygdx.game.engine.events.EventDispatcher com.mygdx.game.entities.weapons.projectiles.BaseHitProjectile com.mygdx.game.entities.weapons.projectiles.ExplosiveProjectile com.mygdx.game.entities.weapons.projectiles.FreezeProjectile com.mygdx.game.entities.weapons.projectiles.NormalProjectile com.mygdx.game.entities.weapons.projectiles.PoisonProjectile

Classes

enum  HeightStage
 

Public Member Functions

 BaseProjectile (RenderInfo renderSheetProjectile, float speed)
 
RenderComponent getRenderComponent ()
 
HeightStage getHeightStage ()
 
void onReceiveEvent (Event event)
 
Vector2 getLandingPositionWithDrawWeight (float drawWeight)
 
void fire (float drawWeight, float drawPower)
 
- Public Member Functions inherited from com.mygdx.game.engine.entities.BaseEntity
 BaseEntity ()
 
TransformComponent getTransformComponent ()
 
boolean hasInstanceOfComponent (BaseEntityComponent componentInstance)
 
void addTag (String tag)
 
void removeTag (String tag)
 
boolean hasTag (String tag)
 
void update (float dt)
 
void render (RenderComponents renderComponents)
 
void destroy ()
 
boolean isDestroyed ()
 
- Public Member Functions inherited from com.mygdx.game.engine.events.EventDispatcher
void addEventListener (String type, IEventReceiver listeningClass)
 
void dispatchEvent (Event event)
 
void removeEventListener (String type, IEventReceiver listener)
 
boolean hasEventListener (String type)
 
ArrayList< ListenerItemgetAllListeners ()
 
void destroyAllListeners ()
 
void clean ()
 

Protected Member Functions

float getDrawPower ()
 
void awake ()
 
abstract void onCollisionEvent (CollisionEvent event)
 
abstract float getWeight ()
 
abstract void onStageChanged (HeightStage newHeightStage)
 
abstract void onLandedOnGround ()
 
void destroyed ()
 
void setHeightStage (HeightStage heightStage)
 
void updated (float dt)
 
- Protected Member Functions inherited from com.mygdx.game.engine.entities.BaseEntity
abstract void awake ()
 
abstract void updated (float dt)
 
abstract void rendered (RenderComponents renderComponents)
 
abstract void destroyed ()
 

Detailed Description

This is the base class for all the projectiles of weapons in the game. This calculates the speed, sorting, collision and landing position of the arrow.

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ BaseProjectile()

com.mygdx.game.entities.weapons.projectiles.BaseProjectile.BaseProjectile ( RenderInfo  renderSheetProjectile,
float  speed 
)

Member Function Documentation

◆ awake()

void com.mygdx.game.entities.weapons.projectiles.BaseProjectile.awake ( )
protected

◆ destroyed()

void com.mygdx.game.entities.weapons.projectiles.BaseProjectile.destroyed ( )
protected

◆ fire()

void com.mygdx.game.entities.weapons.projectiles.BaseProjectile.fire ( float  drawWeight,
float  drawPower 
)

Fires the projectile into the direction its currently facing.

Parameters
drawWeightis the strength the projectile is fired with, this determines its distance.
drawPoweris the power the projectile is fired with, this determines its speed and is affected by the projectile's weight

◆ getDrawPower()

float com.mygdx.game.entities.weapons.projectiles.BaseProjectile.getDrawPower ( )
protected

Gets the draw power this projectile has been fired with.

Returns
Draw power which the projectile has been fired with as float.

◆ getHeightStage()

HeightStage com.mygdx.game.entities.weapons.projectiles.BaseProjectile.getHeightStage ( )

Returns the current HeightStage this projectile is in.

Returns
The current HeightStage of the projectile

◆ getLandingPositionWithDrawWeight()

Vector2 com.mygdx.game.entities.weapons.projectiles.BaseProjectile.getLandingPositionWithDrawWeight ( float  drawWeight)

Returns the landing position in world space calculated with the current drawing weight this projectile would be fired with

Parameters
drawWeightof the weapon
Returns
The position it would land with that amount of draw-weight

◆ getRenderComponent()

RenderComponent com.mygdx.game.entities.weapons.projectiles.BaseProjectile.getRenderComponent ( )

Returns the RenderComponent attached to this Entity

Returns
RenderComponent attached on the Entity

◆ getWeight()

abstract float com.mygdx.game.entities.weapons.projectiles.BaseProjectile.getWeight ( )
abstractprotected

Returns the weight of the projectile.

Returns
The arrow it's weight as float.

◆ onCollisionEvent()

abstract void com.mygdx.game.entities.weapons.projectiles.BaseProjectile.onCollisionEvent ( CollisionEvent  event)
abstractprotected

This will be triggered when the bow collides with an object.

Parameters
eventwhich holds all the collision data

◆ onLandedOnGround()

abstract void com.mygdx.game.entities.weapons.projectiles.BaseProjectile.onLandedOnGround ( )
abstractprotected

This will be triggered when the projectile lands on the ground withot hitting anything.

◆ onReceiveEvent()

void com.mygdx.game.entities.weapons.projectiles.BaseProjectile.onReceiveEvent ( Event  event)

This will be triggered when an event has been fired of type which this implementing class was listening to.

Parameters
eventwhich has one of the event types which is listened to.

Implements com.mygdx.game.engine.events.IEventReceiver.

◆ onStageChanged()

abstract void com.mygdx.game.entities.weapons.projectiles.BaseProjectile.onStageChanged ( HeightStage  newHeightStage)
abstractprotected

This will be triggered every time the projectile's height stage has been changed.

Parameters
newHeightStageIt has been changed to.

◆ setHeightStage()

void com.mygdx.game.entities.weapons.projectiles.BaseProjectile.setHeightStage ( HeightStage  heightStage)
protected

This sets the height stage of the projectile and changes its scale depending on it.

Parameters
heightStage

◆ updated()

void com.mygdx.game.entities.weapons.projectiles.BaseProjectile.updated ( float  dt)
protected

The documentation for this class was generated from the following file: