new BHell_Emitter_Angle()
Angle emitter. Creates a single bullet traveling at an angle. Optionally aims at the player.
- Source:
Extends
Methods
initialize(x, y, params, parent, bulletList)
Constructor. Additional parameters:
- angle: the bullets' traveling angle. If aiming, it will be used as an offset for the angle between the emitter and the player,
- aim: if true the angle is relative to the player's position (i.e. angle = 0 and aim = true: the bullets will point towards the player, angle = 0.1 and aim = true: the bullets will be shot at 0.1 radians counterclockwise, from the player's direction)
- always_aim: if false (and aim = true) aiming only occours when there is a raising edge (shoot(false) -> shoot(true)),
- aim_x aiming horizontal offset (used only if aim = true),
- aim_y: aiming vertical offset (used only if aim = true).
Parameters:
Name | Type | Description |
---|---|---|
x |
||
y |
||
params |
||
parent |
||
bulletList |
- Overrides:
- Source:
move(x, y)
Moves the emitter, relative to the initialised offset.
Parameters:
Name | Type | Description |
---|---|---|
x |
New x coordinate. |
|
y |
New y coordinate. |
- Inherited From:
- Source:
shoot()
Shoots a single bullet towards this.angle or this.angle + angle between player and emitter.
- Overrides:
- Source:
update()
Updates the emitter's sprite and state. Called every frame. Shoots if in shooting state.
- Inherited From:
- Source:
updateCharacterFrame()
Updates the charset frame, calculating the correct offsets.
- Inherited From:
- Source: