Fix colors

This commit is contained in:
Renarde-dev 2025-01-24 21:16:37 +01:00
parent 790385b67a
commit ee2ff1112e
No known key found for this signature in database
GPG key ID: 5B8FE0B3816369DE
11 changed files with 88 additions and 108 deletions

View file

@ -13,6 +13,7 @@ var tambour = null
# Slot actif (0 = Flûte, 1 = Tambour)
var active_slot = 0
var flute_timer = 0
func _ready() -> void:
flute = load("res://scripts/Instrument/Flute.gd").new()
@ -47,22 +48,22 @@ func _process(delta: float) -> void:
if Input.is_action_just_pressed("CHANGER_SLOT"):
active_slot = (active_slot + 1) % 2
if Input.is_action_pressed("JOUER_MUSIQUE_HAUT") or Input.is_action_pressed("JOUER_MUSIQUE_BAS") or Input.is_action_pressed("JOUER_MUSIQUE_DROITE") or Input.is_action_pressed("JOUER_MUSIQUE_GAUCHE"):
var direction_balle = Vector2.ZERO
var angle = 0
if Input.is_action_pressed("JOUER_MUSIQUE_HAUT"):
direction_balle = Vector2(0, -1)
angle = 180
elif Input.is_action_pressed("JOUER_MUSIQUE_BAS"):
direction_balle = Vector2(0, 1)
angle = 0
elif Input.is_action_pressed("JOUER_MUSIQUE_DROITE"):
direction_balle = Vector2(1, 0)
angle = 270
elif Input.is_action_pressed("JOUER_MUSIQUE_GAUCHE"):
direction_balle = Vector2(-1, 0)
angle = 90
var direction_balle = Vector2.ZERO
var angle = 0
if Input.is_action_pressed("JOUER_MUSIQUE_HAUT"):
direction_balle = Vector2(0, -1)
angle = 180
elif Input.is_action_pressed("JOUER_MUSIQUE_BAS"):
direction_balle = Vector2(0, 1)
angle = 0
elif Input.is_action_pressed("JOUER_MUSIQUE_DROITE"):
direction_balle = Vector2(1, 0)
angle = 270
elif Input.is_action_pressed("JOUER_MUSIQUE_GAUCHE"):
direction_balle = Vector2(-1, 0)
angle = 90
if direction_balle != Vector2.ZERO :
if active_slot == 0: # Slot Flûte
flute.jouer_melodie(position, direction_balle, angle)
elif active_slot == 1: # Slot Tambour