first Prototype

This commit is contained in:
Exobyt 2025-08-02 12:27:49 +02:00
parent 89503407e7
commit c887a2168c
78 changed files with 2494 additions and 2 deletions

View file

@ -0,0 +1,31 @@
class_name Obstacle extends CharacterBody2D
@onready var sprite = $Sprite2D
@onready var lifeTimeTimer = $lifeTimeTimer
@export var damage: int = 10
@export var health: int = 1
@export var minHealth: int = 1
@export var maxHealth: int = 1
@export var lifeTime: int = 600
func _ready() -> void:
lifeTimeTimer.start(lifeTime)
health += damage
func spawn(damage: int):
pass
func _on_hurt_area_hurt(amount: int) -> void:
hurt(amount)
func hurt(amount: int):
if health - amount <= minHealth:
queue_free()
else:
health -= amount
func _on_life_time_timer_timeout() -> void:
queue_free()