Classes
Members
boolean
# markToDelete
markToDelete - determines whether or not the bullet should be rendered/updated
Methods
# render(color) → {void}
Render the bullet 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 bullet's x,y coordinates depending on the vector coordinates and projectile
dropoff value, checks frames to ensure the bullet should remain active, and checks for
collision against walls to determine if the bullet 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