import Projectile from 'WTF-Adventure/WTF-Adventure/client/entity/objects/projectile.js'
Constructor Summary
Public Constructor | ||
public |
constructor(id: Number, kind: String, owner: Entity, name: String) Default constructor |
Member Summary
Public Members | ||
public |
Angle of the projectile |
|
public |
X coordinate destination |
|
public |
Y coordinate destination |
|
public |
If this is a dynamic projectile |
|
public |
Callback function for impact |
|
public |
Name of the projectile |
|
public |
Owner of this projectile |
|
public |
Path of the projectile |
|
public |
If this is a special projectile |
|
public |
Speed of the projectile |
|
public |
X coordinate start position |
|
public |
Y coordinate start position |
|
public |
If this is a static projectile |
Method Summary
Public Methods | ||
public |
Return the ID |
|
public |
Gets the speed of the projectile |
|
public |
Return if this has a path |
|
public |
impact() Check if this has made an impact |
|
public |
Set the impact callback |
|
public |
setDestination(x: Number, y: Number) Set the projectile destination |
|
public |
Set the starting point for the projectile |
|
public |
Set the target for the projectile |
|
public |
Update the angle of the projectile |
|
public |
updateTarget(x: Number, y: Number) Update the target location |
Inherited Summary
From class Entity | ||
public |
Angle of the entity |
|
public |
[angled description] |
|
public |
Animations for the sprite |
|
public |
Timeout function for blinking |
|
public |
Count down time |
|
public |
Current counter |
|
public |
Critical health |
|
public |
Current animation the sprite should be playing |
|
public |
Set if the entity is dirty |
|
public |
Callback for when the entity is dirty |
|
public |
Whether or not this is fading |
|
public |
Fading time |
|
public |
Grid X position |
|
public |
Grid Y position |
|
public |
Handler for the entity |
|
public |
Has a counter |
|
public |
Hurt sprite name |
|
public |
Entity id |
|
public |
Label for the entity |
|
public |
Name of the entity |
|
public |
Non pathable |
|
public |
Normal sprite name |
|
public |
Path |
|
public |
CAllback function when the entity is ready |
|
public |
Rendering data |
|
public |
Has a shadow |
|
public |
Offset for the shadow on the Y axis |
|
public |
Sprite |
|
public |
Whether or not to flip the sprite on the X axis |
|
public |
Whether or not to flip the sprite on the Y axis |
|
public |
Whether or not the sprite has been loaded |
|
public |
Stunned status |
|
public |
Terror status |
|
public |
Wehther or not this entity is visible |
|
public |
X coordinate |
|
public |
Y coordinate |
|
public |
Tell this entity to start blinking |
|
public |
Tell this to fade in given the duration |
|
public |
getAnimationByName(name: String): Animation | null Look for an animtions list for this specific animation given it's name |
|
public |
getCoordDistance(toX: Number, toY: Number): Number Get the distance from this entity to the given x,y coordinates |
|
public |
getDistance(entity: Entity): Number Get the distance from this entity to another entity |
|
public |
Returns the name of the sprite |
|
public |
Check if this entity currently has a path |
|
public |
Check whether or not this entity has a shadow |
|
public |
hasWeapon(): Item | Projectile Returns the instance of the weapon this entity has |
|
public |
inAttackRadius(entity: Entity): Boolean Figure out if this entity is within the attack radius of the given entity |
|
public |
inExtraAttackRadius(entity: Entity): Boolean Figure out if this entity is within the extended attack radius of the given entity |
|
public |
isPositionAdjacent(x: Number, y: Number, ignoreDiagonals: Boolean): Boolean Checks to see if the x,y coordinate is adjacent to the entity's current position |
|
public |
Check whether or not this entity is visible |
|
public |
This is important for when the client is on a mobile screen. |
|
public |
When this entity's is dirty (mobile) use this callback |
|
public |
When this entity's sprite is loaded trigger this callback |
|
public |
setAnimation(name: String, speed: Number, count: Number, onEndCount: Number) Set the animation on this entity |
|
public |
setCountdown(count: Number) Set the count for the count down time |
|
public |
setGridPosition(x: Number, y: Number) Set the x,y position of the entity on the tile grid |
|
public |
Set the entity's name |
|
public |
setPosition(x: Number, y: [type]) Set the x,y position for the entity |
|
public |
Set the sprite for this entity |
|
public |
setVisible(visible: Boolean) Set the visibility on this entity |
|
public |
Tell the entity to stop blinking and force it to be visible |
|
public |
Toggle the current visibility of this entity |
Public Constructors
Public Members
Public Methods
public onImpact(callback: Function) source
Set the impact callback
Params:
Name | Type | Attribute | Description |
callback | Function | what happens if the projectile hits |