sploosh! BZAAP!
This commit is contained in:
parent
e5859ae452
commit
9ca4cf10d2
5 changed files with 13 additions and 2 deletions
|
@ -25,6 +25,8 @@ const a_sword = preload("res://audio/sounds/sword.ogg")
|
||||||
const a_doublejump = preload("res://audio/sounds/double_jump.ogg")
|
const a_doublejump = preload("res://audio/sounds/double_jump.ogg")
|
||||||
const a_shoot = preload("res://audio/sounds/shoot_arrow.ogg")
|
const a_shoot = preload("res://audio/sounds/shoot_arrow.ogg")
|
||||||
const a_die = preload("res://audio/sounds/die.ogg")
|
const a_die = preload("res://audio/sounds/die.ogg")
|
||||||
|
const a_die_splash = preload("res://audio/sounds/splash.ogg")
|
||||||
|
const a_die_zap = preload("res://audio/sounds/splash.ogg")
|
||||||
const a_die_skeleton = preload("res://audio/sounds/die_skeleton.ogg")
|
const a_die_skeleton = preload("res://audio/sounds/die_skeleton.ogg")
|
||||||
const a_scrump_die = preload("res://audio/sounds/scrump_die.ogg")
|
const a_scrump_die = preload("res://audio/sounds/scrump_die.ogg")
|
||||||
const a_explosion = preload("res://audio/sounds/explosion.ogg")
|
const a_explosion = preload("res://audio/sounds/explosion.ogg")
|
||||||
|
|
|
@ -50,6 +50,7 @@ var can_restart: bool = true
|
||||||
var current_palette: String = "default"
|
var current_palette: String = "default"
|
||||||
var still_playing: bool = false
|
var still_playing: bool = false
|
||||||
var last_mm_button = null
|
var last_mm_button = null
|
||||||
|
var alternate_death = null
|
||||||
#== marathon mode ==#
|
#== marathon mode ==#
|
||||||
var marathon_mode: bool = false
|
var marathon_mode: bool = false
|
||||||
var marathon_score: int = 0
|
var marathon_score: int = 0
|
||||||
|
@ -317,7 +318,11 @@ func _on_player_died() -> void:
|
||||||
# count death
|
# count death
|
||||||
lives -= 1
|
lives -= 1
|
||||||
# play death sound
|
# play death sound
|
||||||
|
if alternate_death:
|
||||||
|
Audio.play_sound(alternate_death, Audio.ac_die)
|
||||||
|
else:
|
||||||
Audio.play_sound(Audio.a_die, Audio.ac_die)
|
Audio.play_sound(Audio.a_die, Audio.ac_die)
|
||||||
|
alternate_death = null
|
||||||
# death score penalty
|
# death score penalty
|
||||||
if use_lives == false && lives < 0:
|
if use_lives == false && lives < 0:
|
||||||
score = max(0, score - 500) as int
|
score = max(0, score - 500) as int
|
||||||
|
|
|
@ -3,4 +3,5 @@ extends Area2D
|
||||||
func _on_Area2D_area_entered(area):
|
func _on_Area2D_area_entered(area):
|
||||||
#Kill player
|
#Kill player
|
||||||
if area.is_in_group("player_hitbox"):
|
if area.is_in_group("player_hitbox"):
|
||||||
|
Game.alternate_death = Audio.a_die_zap
|
||||||
area.get_parent().die()
|
area.get_parent().die()
|
||||||
|
|
|
@ -517,11 +517,14 @@ func _on_Hitbox_body_entered(body: Node) -> void:
|
||||||
if body.is_in_group("no_blood"):
|
if body.is_in_group("no_blood"):
|
||||||
skip_blood = true
|
skip_blood = true
|
||||||
if body.is_in_group("has_splash"):
|
if body.is_in_group("has_splash"):
|
||||||
|
Game.alternate_death = Audio.a_die_splash
|
||||||
var particles = SplashParticles.instance()
|
var particles = SplashParticles.instance()
|
||||||
particles.global_position = death_splatter_position.global_position
|
particles.global_position = death_splatter_position.global_position
|
||||||
particles.color = body.splash_color
|
particles.color = body.splash_color
|
||||||
particles.emitting = true
|
particles.emitting = true
|
||||||
get_parent().add_child(particles)
|
get_parent().add_child(particles)
|
||||||
|
if body.is_in_group("death_zap"):
|
||||||
|
Game.alternate_death = Audio.a_die_zap
|
||||||
die()
|
die()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1302,8 +1302,8 @@ align = 1
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_entered"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Teleporting_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Teleporting_state_entered"]
|
||||||
[connection signal="state_exited" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_exited"]
|
[connection signal="state_exited" from="StateChart/Root/Movement/Teleporting" to="." method="_on_Inactive_state_exited"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Appearing" to="." method="_on_Inactive_state_entered"]
|
|
||||||
[connection signal="state_entered" from="StateChart/Root/Movement/Appearing" to="." method="_on_Appearing_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Movement/Appearing" to="." method="_on_Appearing_state_entered"]
|
||||||
|
[connection signal="state_entered" from="StateChart/Root/Movement/Appearing" to="." method="_on_Inactive_state_entered"]
|
||||||
[connection signal="state_exited" from="StateChart/Root/Movement/Appearing" to="." method="_on_Inactive_state_exited"]
|
[connection signal="state_exited" from="StateChart/Root/Movement/Appearing" to="." method="_on_Inactive_state_exited"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Health/Respawn" to="." method="_on_Respawn_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Health/Respawn" to="." method="_on_Respawn_state_entered"]
|
||||||
[connection signal="state_entered" from="StateChart/Root/Health/Dead" to="." method="_on_Dead_state_entered"]
|
[connection signal="state_entered" from="StateChart/Root/Health/Dead" to="." method="_on_Dead_state_entered"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue