26 lines
888 B
GDScript3
26 lines
888 B
GDScript3
|
|
class_name BombBlastVFX
|
||
|
|
extends LightBurstVFX
|
||
|
|
|
||
|
|
|
||
|
|
func _init() -> void:
|
||
|
|
# #114: the bomber's blast. Between a hull going up and a structure
|
||
|
|
# coming down - it is the biggest thing an enemy can do to the player
|
||
|
|
# without destroying anything outright, and it should land like it.
|
||
|
|
color = Color(1.0, 0.5, 0.2)
|
||
|
|
particle_count = 26
|
||
|
|
lifetime = 0.8
|
||
|
|
min_speed = 140.0
|
||
|
|
max_speed = 520.0
|
||
|
|
shockwave_radius = 150.0
|
||
|
|
shockwave_color = Color(1.0, 0.78, 0.4)
|
||
|
|
|
||
|
|
|
||
|
|
# Takes the colour from the shell that threw it, so a bomber recoloured in
|
||
|
|
# its definition does not explode in the default orange.
|
||
|
|
static func spawn(parent: Node, world_position: Vector2,
|
||
|
|
blast_color: Color = Color(1.0, 0.5, 0.2)) -> void:
|
||
|
|
var vfx: BombBlastVFX = BombBlastVFX.new()
|
||
|
|
vfx.position = world_position
|
||
|
|
vfx.color = blast_color
|
||
|
|
vfx.shockwave_color = blast_color.lerp(Color(1.0, 0.95, 0.8), 0.45)
|
||
|
|
parent.add_child(vfx)
|