Added spikes, Made a way to transition from level to level, and a base level to make level creation easier
This commit is contained in:
@@ -55,17 +55,9 @@ func player_death() -> void:
|
||||
Util.add_effect_to_self(self, deathEffect)
|
||||
queue_free()
|
||||
|
||||
func _on_hurt_box_area_entered(area: Area2D) -> void:
|
||||
#this checks if the area is a bullet
|
||||
if !area.get_parent().is_in_group("Enemy Bullet"):
|
||||
return
|
||||
var body = area.get_parent() as Node
|
||||
hurt(body)
|
||||
|
||||
func _on_hurt_box_body_entered(body: Node2D) -> void:
|
||||
if !body.is_in_group("Enemy"):
|
||||
return
|
||||
hurt(body)
|
||||
func _on_hurt_box_area_entered(_area: Area2D) -> void:
|
||||
player_death()
|
||||
GameManager.reset_level()
|
||||
|
||||
func hurt(enemy: Node2D) -> void:
|
||||
PlayerManager.decress_health(enemy.damage)
|
||||
|
||||
Reference in New Issue
Block a user