Bandidos
|
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< ListenerItem > | getAllListeners () |
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 () |
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.
com.mygdx.game.entities.weapons.projectiles.BaseProjectile.BaseProjectile | ( | RenderInfo | renderSheetProjectile, |
float | speed | ||
) |
|
protected |
|
protected |
void com.mygdx.game.entities.weapons.projectiles.BaseProjectile.fire | ( | float | drawWeight, |
float | drawPower | ||
) |
Fires the projectile into the direction its currently facing.
drawWeight | is the strength the projectile is fired with, this determines its distance. |
drawPower | is the power the projectile is fired with, this determines its speed and is affected by the projectile's weight |
|
protected |
Gets the draw power this projectile has been fired with.
HeightStage com.mygdx.game.entities.weapons.projectiles.BaseProjectile.getHeightStage | ( | ) |
Returns the current HeightStage this projectile is in.
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
drawWeight | of the weapon |
RenderComponent com.mygdx.game.entities.weapons.projectiles.BaseProjectile.getRenderComponent | ( | ) |
Returns the RenderComponent attached to this Entity
|
abstractprotected |
Returns the weight of the projectile.
|
abstractprotected |
This will be triggered when the bow collides with an object.
event | which holds all the collision data |
|
abstractprotected |
This will be triggered when the projectile lands on the ground withot hitting anything.
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.
event | which has one of the event types which is listened to. |
Implements com.mygdx.game.engine.events.IEventReceiver.
|
abstractprotected |
This will be triggered every time the projectile's height stage has been changed.
newHeightStage | It has been changed to. |
|
protected |
This sets the height stage of the projectile and changes its scale depending on it.
heightStage |
|
protected |