Ajout des musiques, de l'IU avec barre de vie et inventaire
This commit is contained in:
parent
4bab72b7d4
commit
ba0f893fde
8 changed files with 1186 additions and 1 deletions
90
scenes/interface.gd
Normal file
90
scenes/interface.gd
Normal file
|
@ -0,0 +1,90 @@
|
|||
extends Control
|
||||
|
||||
@onready var coeur1 = $VBoxContainer/HBoxContainer/TextureRect1
|
||||
@onready var coeur2 = $VBoxContainer/HBoxContainer/TextureRect2
|
||||
@onready var coeur3 = $VBoxContainer/HBoxContainer/TextureRect3
|
||||
@onready var coeur4 = $VBoxContainer/HBoxContainer/TextureRect4
|
||||
@onready var coeur5 = $VBoxContainer/HBoxContainer/TextureRect5
|
||||
#Les coeurs, 1 étant le plus à gauche et 5 le plus à droite
|
||||
|
||||
@onready var slot1 = $VBoxContainer/HBoxContainer2/TextureRect
|
||||
@onready var slot2 = $VBoxContainer/HBoxContainer2/TextureRect2
|
||||
|
||||
@onready var life : int = 10
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func healing(pv : int) -> void :
|
||||
for i in range(life , life+pv+1):
|
||||
update_life(i)
|
||||
|
||||
func update_life (pv : int) -> void :
|
||||
match pv :
|
||||
0 :
|
||||
coeur1.hide()
|
||||
#Rajouter ici la gestion de la mort
|
||||
1 :
|
||||
coeur1.texture = load("res://ressources/images/half_heart.svg")
|
||||
2 :
|
||||
coeur1.texture = load("res://ressources/images/full_heart.svg")
|
||||
coeur2.hide()
|
||||
3 :
|
||||
coeur2.texture = load("res://ressources/images/half_heart.svg")
|
||||
coeur2.show()
|
||||
4 :
|
||||
coeur2.texture = load("res://ressources/images/full_heart.svg")
|
||||
coeur3.hide()
|
||||
5 :
|
||||
coeur3.texture = load("res://ressources/images/half_heart.svg")
|
||||
coeur3.show()
|
||||
6 :
|
||||
coeur3.texture = load("res://ressources/images/full_heart.svg")
|
||||
coeur4.hide()
|
||||
7 :
|
||||
coeur4.texture = load("res://ressources/images/half_heart.svg")
|
||||
coeur4.show()
|
||||
8 :
|
||||
coeur4.texture = load("res://ressources/images/full_heart.svg")
|
||||
coeur5.hide()
|
||||
9 :
|
||||
coeur5.texture = load("res://ressources/images/half_heart.svg")
|
||||
coeur5.show()
|
||||
10 :
|
||||
coeur5.texture = load("res://ressources/images/full_heart.svg")
|
||||
_ :
|
||||
return
|
||||
|
||||
life = pv
|
||||
|
||||
|
||||
func update_instrument (listeInstrument : Array) -> void :
|
||||
if len(listeInstrument) < 2 :
|
||||
slot1.texture = load("res://ressources/images/empty_slot.svg")
|
||||
slot2.texture = load("res://ressources/images/empty_slot.svg")
|
||||
|
||||
match listeInstrument[0] :
|
||||
"flute" :
|
||||
slot1.texture = load("res://ressources/images/flute.svg")
|
||||
"tambour" :
|
||||
slot1.texture = load("res://ressources/images/tambour.svg")
|
||||
"lyre" :
|
||||
slot1.texture = load("res://ressources/images/lyre.svg")
|
||||
_ :
|
||||
slot1.texture = load("res://ressources/images/empty_slot.svg")
|
||||
|
||||
match listeInstrument[1] :
|
||||
"flute" :
|
||||
slot2.texture = load("res://ressources/images/flute.svg")
|
||||
"tambour" :
|
||||
slot2.texture = load("res://ressources/images/tambour.svg")
|
||||
"lyre" :
|
||||
slot2.texture = load("res://ressources/images/lyre.svg")
|
||||
_ :
|
||||
slot2.texture = load("res://ressources/images/empty_slot.svg")
|
Loading…
Add table
Add a link
Reference in a new issue