Cleanup commit
This commit is contained in:
parent
bc8663063e
commit
e599032a77
50 changed files with 1454 additions and 35 deletions
|
|
@ -9,6 +9,10 @@ onready var player_sounds = get_node("AudioStream")
|
|||
|
||||
# Other resources -- this will need to be updated for mainhand as well
|
||||
var JumpSound = preload('res://assets/sounds/player_jump.wav')
|
||||
var HurtSounds = [
|
||||
preload('res://assets/sounds/damage/player_hit1.wav'),
|
||||
preload('res://assets/sounds/damage/player_hit2.wav'),
|
||||
]
|
||||
|
||||
var vel : Vector2
|
||||
|
||||
|
|
@ -49,3 +53,10 @@ func _physics_process(_delta):
|
|||
|
||||
|
||||
vel = move_and_slide_with_snap(next_move, Vector2.DOWN, Vector2.UP)
|
||||
|
||||
# Handle damage
|
||||
for i in get_slide_count():
|
||||
var col = get_slide_collision(i).collider
|
||||
if col is KinematicBody2D:
|
||||
player_sounds.stream = HurtSounds[1]
|
||||
player_sounds.play()
|
||||
|
|
|
|||
Loading…
Reference in a new issue