Bombs game ending, and debugging.
This commit is contained in:
@ -8,7 +8,9 @@ var damage = 0
|
||||
var current_health = 0
|
||||
var current_shield = 0
|
||||
|
||||
var last_position: Vector2 = Vector2.ZERO # To store the previous position
|
||||
var last_position: Vector2 = Vector2.ZERO # for previous position
|
||||
|
||||
static var NAMES = ["Forkman", "Cobold", "Ork"]
|
||||
|
||||
func _ready() -> void:
|
||||
last_position = get_parent().position
|
||||
@ -119,5 +121,14 @@ func AnimatedSprite2D_animation_finished() -> void:
|
||||
|
||||
func Collision_Handler(body: Node2D):
|
||||
if body.get_parent().name.contains("StickTrap"):
|
||||
enemy_hurt(25)
|
||||
get_node("CharacterBody2D/AnimatedSprite2D").play("hurt")
|
||||
if not body.get_parent().get_if_moving_state():
|
||||
enemy_hurt(25)
|
||||
get_node("CharacterBody2D/AnimatedSprite2D").play("hurt")
|
||||
if body.get_parent().name.contains("Mine"):
|
||||
if not body.get_parent().get_if_moving_state():
|
||||
var surrounding_enemies = body.get_node("Area2D").get_overlapping_bodies()
|
||||
for i in surrounding_enemies:
|
||||
if i. get_parent().name in NAMES:
|
||||
enemy_hurt(100)
|
||||
body.get_parent().Explode_Mine()
|
||||
|
||||
|
Reference in New Issue
Block a user