change format style
This commit is contained in:
parent
8e30badc8f
commit
55767a4bd9
3 changed files with 48 additions and 50 deletions
46
Characters/Villain.gd
Normal file → Executable file
46
Characters/Villain.gd
Normal file → Executable file
|
@ -10,30 +10,30 @@ onready var button = $"../Button/"
|
|||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
timer = 0
|
||||
rng.randomize()
|
||||
limit_random = rng.randi_range(2, 10)
|
||||
timer = 0
|
||||
rng.randomize()
|
||||
limit_random = rng.randi_range(2, 10)
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
timer += delta
|
||||
match me.get_frame():
|
||||
0:
|
||||
# Vert
|
||||
if timer >= limit_random:
|
||||
timer = 0
|
||||
limit_random = rng.randi_range(2, 10)
|
||||
me.set_frame(1)
|
||||
1:
|
||||
# Orange
|
||||
if timer >= .5:
|
||||
timer = 0
|
||||
me.set_frame(2)
|
||||
2:
|
||||
# Rouge
|
||||
if timer >= 2:
|
||||
timer = 0
|
||||
me.set_frame(0)
|
||||
_:
|
||||
print("Not handled frame")
|
||||
timer += delta
|
||||
match me.get_frame():
|
||||
0:
|
||||
# Vert
|
||||
if timer >= limit_random:
|
||||
timer = 0
|
||||
limit_random = rng.randi_range(2, 10)
|
||||
me.set_frame(1)
|
||||
1:
|
||||
# Orange
|
||||
if timer >= .5:
|
||||
timer = 0
|
||||
me.set_frame(2)
|
||||
2:
|
||||
# Rouge
|
||||
if timer >= 2:
|
||||
timer = 0
|
||||
me.set_frame(0)
|
||||
_:
|
||||
print("Not handled frame")
|
||||
|
|
|
@ -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.
|
||||
func _ready():
|
||||
etat = false
|
||||
pass # Replace with function body.
|
||||
etat = false
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(_delta):
|
||||
match villain.get_frame():
|
||||
2:
|
||||
if etat:
|
||||
print("non")
|
||||
else:
|
||||
print("caché")
|
||||
_:
|
||||
if etat:
|
||||
print("oui")
|
||||
else:
|
||||
print("caché")
|
||||
match villain.get_frame():
|
||||
2:
|
||||
if etat:
|
||||
print("non")
|
||||
else:
|
||||
print("caché")
|
||||
_:
|
||||
if etat:
|
||||
print("oui")
|
||||
else:
|
||||
print("caché")
|
||||
|
||||
|
||||
func _on_Button_pressed():
|
||||
etat = !etat
|
||||
"""
|
||||
if(etat) :
|
||||
self.StyleBoxTexture.set_texture(_texture1) # reste appuyé
|
||||
else :
|
||||
self.StyleBoxTexture.set_texture(_texture2) # pas appuyé
|
||||
etat = !etat
|
||||
|
||||
"""
|
||||
if(etat) :
|
||||
self.StyleBoxTexture.set_texture(_texture1) # reste appuyé
|
||||
else :
|
||||
self.StyleBoxTexture.set_texture(_texture2) # pas appuyé
|
||||
|
|
12
Scenes/Screen_Menu.gd
Normal file → Executable file
12
Scenes/Screen_Menu.gd
Normal file → Executable file
|
@ -3,7 +3,7 @@ extends Control
|
|||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
pass # Replace with function body.
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
|
@ -12,14 +12,14 @@ func _ready():
|
|||
|
||||
|
||||
func _on_PlayButton_pressed():
|
||||
print("ici")
|
||||
get_tree().change_scene("res://Scenes/Node2D.tscn")
|
||||
print("ici")
|
||||
get_tree().change_scene("res://Scenes/Node2D.tscn")
|
||||
|
||||
|
||||
func _on_Help_Button_pressed():
|
||||
print("help")
|
||||
print("help")
|
||||
|
||||
|
||||
func _on_Quit_Button_pressed():
|
||||
get_tree().quit()
|
||||
# Replace with function body.
|
||||
get_tree().quit()
|
||||
# Replace with function body.
|
||||
|
|
Reference in a new issue