change format style

This commit is contained in:
Mylloon 2023-02-25 14:25:51 +01:00
parent 8e30badc8f
commit 55767a4bd9
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 48 additions and 50 deletions

46
Characters/Villain.gd Normal file → Executable file
View file

@ -10,30 +10,30 @@ onready var button = $"../Button/"
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
timer = 0 timer = 0
rng.randomize() rng.randomize()
limit_random = rng.randi_range(2, 10) limit_random = rng.randi_range(2, 10)
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta): func _process(delta):
timer += delta timer += delta
match me.get_frame(): match me.get_frame():
0: 0:
# Vert # Vert
if timer >= limit_random: if timer >= limit_random:
timer = 0 timer = 0
limit_random = rng.randi_range(2, 10) limit_random = rng.randi_range(2, 10)
me.set_frame(1) me.set_frame(1)
1: 1:
# Orange # Orange
if timer >= .5: if timer >= .5:
timer = 0 timer = 0
me.set_frame(2) me.set_frame(2)
2: 2:
# Rouge # Rouge
if timer >= 2: if timer >= 2:
timer = 0 timer = 0
me.set_frame(0) me.set_frame(0)
_: _:
print("Not handled frame") print("Not handled frame")

View file

@ -8,31 +8,29 @@ var _texture2 = load("res://Assets//skin_assets/button_pressed.png")
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
etat = false etat = false
pass # Replace with function body. pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta): func _process(_delta):
match villain.get_frame(): match villain.get_frame():
2: 2:
if etat: if etat:
print("non") print("non")
else: else:
print("caché") print("caché")
_: _:
if etat: if etat:
print("oui") print("oui")
else: else:
print("caché") print("caché")
func _on_Button_pressed(): func _on_Button_pressed():
etat = !etat etat = !etat
"""
if(etat) : if(etat) :
self.StyleBoxTexture.set_texture(_texture1) # reste appuyé self.StyleBoxTexture.set_texture(_texture1) # reste appuyé
else : else :
self.StyleBoxTexture.set_texture(_texture2) # pas appuyé self.StyleBoxTexture.set_texture(_texture2) # pas appuyé
"""

12
Scenes/Screen_Menu.gd Normal file → Executable file
View file

@ -3,7 +3,7 @@ extends Control
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():
pass # Replace with function body. pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
@ -12,14 +12,14 @@ func _ready():
func _on_PlayButton_pressed(): func _on_PlayButton_pressed():
print("ici") print("ici")
get_tree().change_scene("res://Scenes/Node2D.tscn") get_tree().change_scene("res://Scenes/Node2D.tscn")
func _on_Help_Button_pressed(): func _on_Help_Button_pressed():
print("help") print("help")
func _on_Quit_Button_pressed(): func _on_Quit_Button_pressed():
get_tree().quit() get_tree().quit()
# Replace with function body. # Replace with function body.