Merged with daniel-hell-level and modified weapon handling

This commit is contained in:
VoidTwo
2021-12-05 17:19:07 -06:00
87 changed files with 2724 additions and 23 deletions

View File

@@ -4,6 +4,7 @@ const SPEED: int = 50
var player: KinematicBody2D = null
var velocity: Vector2 = Vector2.ZERO
var health: int = 2
func _physics_process(_delta: float) -> void:
@@ -26,3 +27,14 @@ func _on_player_detector_body_exited(body: Node) -> void:
if body.is_in_group('player'):
player = null
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