This commit is contained in:
Mylloon 2023-02-25 14:17:42 +01:00
parent ad43444126
commit 3c6025811b
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 16 additions and 13 deletions

19
Scenes/Button_Node2D.gd Normal file → Executable file
View file

@ -1,7 +1,7 @@
extends Button extends Button
onready var villain = $"../Villain/AnimatedSprite" onready var villain = $"../Villain/AnimatedSprite"
var etat var etat
var _texture1 = load("res://Assets//skin_assets/button_normal.png") var _texture1 = load("res://Assets//skin_assets/button_normal.png")
var _texture2 = load("res://Assets//skin_assets/button_pressed.png") var _texture2 = load("res://Assets//skin_assets/button_pressed.png")
@ -9,19 +9,22 @@ 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) : print("non") if etat:
else: print("caché") print("non")
else:
print("caché")
_: _:
if(etat) : print("oui") if etat:
else: print("caché") print("oui")
# pass else:
print("caché")
func _on_Button_pressed(): func _on_Button_pressed():
@ -33,5 +36,3 @@ func _on_Button_pressed():
self.StyleBoxTexture.set_texture(_texture2) # pas appuyé self.StyleBoxTexture.set_texture(_texture2) # pas appuyé
""" """
""" """

View file

@ -1,8 +1,9 @@
extends Control 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.
@ -13,11 +14,12 @@ 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.