Merged with daniel-hell-level and modified weapon handling
This commit is contained in:
@@ -6,6 +6,7 @@ export var creepy_hand: PackedScene
|
||||
|
||||
var player: KinematicBody2D = null
|
||||
var velocity: Vector2 = Vector2.ZERO
|
||||
var health: int = 3
|
||||
|
||||
|
||||
func _physics_process(_delta: float) -> void:
|
||||
@@ -39,3 +40,14 @@ func _on_projectile_timer_timeout() -> void:
|
||||
projectile.init($Sprite.global_position, player.position)
|
||||
get_tree().get_current_scene().get_node('Projectiles').add_child(projectile)
|
||||
return
|
||||
|
||||
|
||||
func _on_hitbox_area_entered(area: Area2D) -> void:
|
||||
if area.is_in_group('player_weapon_1'):
|
||||
health -= 1
|
||||
elif area.is_in_group('player_weapon_2'):
|
||||
health -= 2
|
||||
|
||||
if health <= 0:
|
||||
call_deferred('queue_free')
|
||||
return
|
||||
|
Reference in New Issue
Block a user