GET BZAPPED
This commit is contained in:
parent
c97f41fb47
commit
45ffc4d3b7
5 changed files with 303 additions and 6 deletions
|
@ -151,6 +151,9 @@ func spawn_arrow() -> void:
|
|||
func die() -> void:
|
||||
state_chart.send_event("hurt")
|
||||
|
||||
func zap() -> void:
|
||||
state_chart.send_event("zapped")
|
||||
|
||||
func set_underwater_audio(value):
|
||||
var idx = AudioServer.get_bus_index("Master")
|
||||
AudioServer.set_bus_effect_enabled(idx,0,value)
|
||||
|
@ -540,3 +543,29 @@ func _on_OxygenTimer_timeout():
|
|||
#Reset low oxygen effect when leaving level
|
||||
func _on_Player_tree_exited():
|
||||
set_underwater_audio(false)
|
||||
|
||||
|
||||
func _on_Zapping_state_entered():
|
||||
velocity = Vector2.ZERO
|
||||
Audio.play_sound(Audio.a_die_zap, Audio.ac_die)
|
||||
animation_player.call_deferred("play", "zap")
|
||||
|
||||
|
||||
func make_blood():
|
||||
var particles = DeathSplatter.instance()
|
||||
particles.global_position = death_splatter_position.global_position
|
||||
particles.emitting = true
|
||||
get_parent().add_child(particles)
|
||||
for i in 16:
|
||||
var spray = BloodSpray.instance()
|
||||
spray.pause_mode = PAUSE_MODE_PROCESS
|
||||
Physics2DServer.set_active(true)
|
||||
spray.global_position = death_splatter_position.global_position
|
||||
spray.velocity = Vector2(randf() * 80.0, 0.0).rotated(randf() * TAU)
|
||||
spray.stains_player = false
|
||||
get_parent().add_child(spray)
|
||||
|
||||
|
||||
func _on_Zapping_state_exited():
|
||||
$Graphics/ZapSprite.visible = false
|
||||
emit_signal("died")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue