Bandidos
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
com.mygdx.game.entities.weapons.BaseBowWeapon Class Referenceabstract
Inheritance diagram for com.mygdx.game.entities.weapons.BaseBowWeapon:
com.mygdx.game.entities.weapons.BaseWeapon com.mygdx.game.engine.entities.BaseEntity com.mygdx.game.entities.weapons.IWeapon com.mygdx.game.engine.events.EventDispatcher com.mygdx.game.entities.weapons.BowWeapon

Classes

enum  BowStage
 

Public Member Functions

 BaseBowWeapon (RenderInfo renderInfoBow)
 
WeaponType getWeaponType ()
 
void startControl (int x, int y)
 
void inControl (int x, int y)
 
void endControl (int x, int y)
 
void clean ()
 
BowStage getCurrentBowStage ()
 
BaseProjectile getCurrentProjectile ()
 
float getCurrentDrawStrength ()
 
void activateSpecial (int specialType)
 
- 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 ()
 

Static Public Attributes

static final float MAX_DRAW_STRENGTH = 30f
 
static final float MAX_DRAW_LENGTH = 200f
 

Protected Member Functions

void updated (float dt)
 
void destroyed ()
 
float powerToDistancePower ()
 
abstract BaseProjectile createRandomSpecialProjectile (int specialType)
 
abstract void selectedTarget (int x, int y)
 
abstract void drawingBow (int x, int y)
 
abstract void shotBow (float strengthPercentage, float minimum)
 
abstract void bowSetToStage (BowStage stage)
 
abstract Vector2 projectilePullDistance ()
 
abstract BaseProjectile getProjectileInstance ()
 
- 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 Bow like weapons.

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ BaseBowWeapon()

com.mygdx.game.entities.weapons.BaseBowWeapon.BaseBowWeapon ( RenderInfo  renderInfoBow)

In order to work, the bow needs a RenderInfo which contain different frames of "Pulling the string"

Parameters
renderInfoBowOf a bow with all the frames of pulling the string

Member Function Documentation

◆ activateSpecial()

void com.mygdx.game.entities.weapons.BaseBowWeapon.activateSpecial ( int  specialType)

This activates the special ability of the weapon

Parameters
specialTypeis a user defines special type

Implements com.mygdx.game.entities.weapons.IWeapon.

◆ bowSetToStage()

abstract void com.mygdx.game.entities.weapons.BaseBowWeapon.bowSetToStage ( BowStage  stage)
abstractprotected

Called when the bow has been switched in stage

Parameters
stageit has been switched to

◆ clean()

void com.mygdx.game.entities.weapons.BaseBowWeapon.clean ( )

Makes the class ready for garbage collection.

Implements com.mygdx.game.entities.weapons.IWeapon.

◆ createRandomSpecialProjectile()

abstract BaseProjectile com.mygdx.game.entities.weapons.BaseBowWeapon.createRandomSpecialProjectile ( int  specialType)
abstractprotected

◆ destroyed()

void com.mygdx.game.entities.weapons.BaseBowWeapon.destroyed ( )
protected

◆ drawingBow()

abstract void com.mygdx.game.entities.weapons.BaseBowWeapon.drawingBow ( int  x,
int  y 
)
abstractprotected

Called every frame when the bow is in its drawing stage

Parameters
xlocation which the current aim is pointed at
ylocation which the current aim is pointed at

◆ endControl()

void com.mygdx.game.entities.weapons.BaseBowWeapon.endControl ( int  x,
int  y 
)

Where the touch is when the weapon control stops

Parameters
xposition of the touch
yposition of the touch

Implements com.mygdx.game.entities.weapons.IWeapon.

◆ getCurrentBowStage()

BowStage com.mygdx.game.entities.weapons.BaseBowWeapon.getCurrentBowStage ( )

Returns the current stage the bow is in.

Returns
The current BowStage

◆ getCurrentDrawStrength()

float com.mygdx.game.entities.weapons.BaseBowWeapon.getCurrentDrawStrength ( )

Returns the current draw strength value of the bow. (Normalized value, 0 being weakest and 1 being the strongest)

Returns
Draw strength value normalized

◆ getCurrentProjectile()

BaseProjectile com.mygdx.game.entities.weapons.BaseBowWeapon.getCurrentProjectile ( )

Returns the current loaded projectile instance on the bow

Returns
The ArrowProjectile instance loaded on the bow.

◆ getProjectileInstance()

abstract BaseProjectile com.mygdx.game.entities.weapons.BaseBowWeapon.getProjectileInstance ( )
abstractprotected

Called when the bow needs a new ArrowProjectile.

Returns
ArrowProjectile to load on the bow as new current projectile

◆ getWeaponType()

WeaponType com.mygdx.game.entities.weapons.BaseBowWeapon.getWeaponType ( )

Returns the weapon type of this weapon instance.

Returns
WeaponType of this weapon.

Implements com.mygdx.game.entities.weapons.IWeapon.

◆ inControl()

void com.mygdx.game.entities.weapons.BaseBowWeapon.inControl ( int  x,
int  y 
)

Where the touch is while it is controlling the weapon

Parameters
xposition of the touch
yposition of the touch

Implements com.mygdx.game.entities.weapons.IWeapon.

◆ powerToDistancePower()

float com.mygdx.game.entities.weapons.BaseBowWeapon.powerToDistancePower ( )
protected

Returns the distance the bow can shoot in pixels with its draw strength.

Returns
Max distance in pixels

◆ projectilePullDistance()

abstract Vector2 com.mygdx.game.entities.weapons.BaseBowWeapon.projectilePullDistance ( )
abstractprotected

Called to position the projectile on the bow. Indicates the distance the projectile should be positioned in delta from its original position. (To match the bow draw animation)

Returns
The Delta vector in which it should differ the position

◆ selectedTarget()

abstract void com.mygdx.game.entities.weapons.BaseBowWeapon.selectedTarget ( int  x,
int  y 
)
abstractprotected

Called when a target location is selected to start the aim at

Parameters
xindicates the x position of the selected location to start the aim
yindicates the y position of the selected location to start the aim

◆ shotBow()

abstract void com.mygdx.game.entities.weapons.BaseBowWeapon.shotBow ( float  strengthPercentage,
float  minimum 
)
abstractprotected

Called when the bow has shot an ArrowProjectile

Parameters
strengthPercentageis the normalized strength used to fire the projectile
minimumis the minimum percentage which the strengthPercentage should be clamped to

◆ startControl()

void com.mygdx.game.entities.weapons.BaseBowWeapon.startControl ( int  x,
int  y 
)

Where the touch is when it starts controlling the weapon

Parameters
xposition of the touch
yposition of the touch

Implements com.mygdx.game.entities.weapons.IWeapon.

◆ updated()

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

Member Data Documentation

◆ MAX_DRAW_LENGTH

final float com.mygdx.game.entities.weapons.BaseBowWeapon.MAX_DRAW_LENGTH = 200f
static

◆ MAX_DRAW_STRENGTH

final float com.mygdx.game.entities.weapons.BaseBowWeapon.MAX_DRAW_STRENGTH = 30f
static

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