Classes
Members
boolean
# markToDelete
markToDelete - determines whether or not the grenade should be rendered/updated
Methods
# render(color) → {void}
Render the grenade projectile on the canvas.
This is called every frame/repaint to render the bullet. Note that this
is an animated entity, therefore the x,y coordinates will change on update.
Parameters:
Name | Type | Description |
---|---|---|
color |
array
|
string
|
the color(s) of the projectile. |
void
# update(walls, dropoff) → {void}
Update the projectile data for bounds tracking, collision and cleanup.
Updates the grenade's x,y coordinates depending on the vector coordinates and projectile
dropoff value, checks frames to ensure the grenade should remain active, and checks for
collision against walls to determine if the grenade should remain active. This is called
every frame/repaint.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
walls |
Array.<Wall>
|
the rendered walls | |
dropoff |
number
|
25 | the projectile dropoff rate |
void