new BHell_Bullet()
Bullet class. Represents a single bullet moving straight on the map.
Extends
Methods
destroy()
Removes the bullet from the screen and from its container.
initialize(x, y, angle, params, bulletList)
Constructor. Parameters:
- speed: Moving speed (in pixels per frame),
- sprite: Bullet's charset,
- index: Charset index,
- direction: Charset direction,
- frame: Initial charset frame,
- animated: If true, the bullet's sprite will be animated,
- animation_speed: Number of updates required for frame change.
Parameters:
Name | Type | Description |
---|---|---|
x |
Initial x coordinate. |
|
y |
Initial y coordinate. |
|
angle |
Moving angle. |
|
params |
Parameters object. |
|
bulletList |
Array in which this bullet is contained. |
- Overrides:
- Source:
update()
Updates the bullet's position. If it leaves the screen, it's destroyed.
- Overrides:
- Source:
updateCharacterFrame()
Updates the charset frame, calculating the correct offsets.
- Inherited From:
- Source: