back end degat vie

This commit is contained in:
Elouan 2025-01-25 02:33:26 +01:00
parent c3d84f1e17
commit 7b66e219b2
8 changed files with 138 additions and 14 deletions

View file

@ -1,5 +1,7 @@
extends CharacterBody2D
@export var interface : Control
const move_speed = 400
const acceleration = 0.25
const max_boost_speed = 800
@ -19,21 +21,22 @@ var flute_cooldown = 0.5
var tambour_cooldown = 3.0
var lyre_cooldown = 1
var slot = [null, null]
var slot = []
var slotstr = []
var vie = 10
func _ready() -> void:
flute = load("res://scripts/Instrument/Flute.gd").new()
flute.set_scene_parent(get_tree().get_root())
slot.append(flute)
tambour = load("res://scripts/Instrument/Tambour.gd").new()
tambour.set_scene_parent(get_tree().get_root())
lyre = load("res://scripts/Instrument/Lyre.gd").new()
lyre.set_scene_parent(get_tree().get_root())
slot.append(lyre)
func _physics_process(delta: float) -> void:
@ -103,6 +106,6 @@ func _process(delta: float) -> void:
func take_damage(dmg : int) :
vie -= dmg
print(vie)
interface.set_life(vie)
if vie <= 0:
queue_free()