diff --git a/mini-game/scenes/decor/instructionsUI.gd b/mini-game/scenes/decor/instructionsUI.gd new file mode 100644 index 0000000..32154df --- /dev/null +++ b/mini-game/scenes/decor/instructionsUI.gd @@ -0,0 +1,34 @@ +extends Control + + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" + +var jumped = false + +func _wait_for_jump(): + var t = Timer.new() + t.set_wait_time(0.5) + add_child(t) + t.start() + while(!jumped): + yield(t, "timeout") + if visible: + hide() + else: + show() + hide() + +func _input(event): + if event.is_action_pressed("ui_accept"): + jumped = true + +# Called when the node enters the scene tree for the first time. +func _ready(): + hide() + + +func _init(): + show() + _wait_for_jump() diff --git a/mini-game/scenes/decor/instructionsUI.tscn b/mini-game/scenes/decor/instructionsUI.tscn new file mode 100644 index 0000000..ad67b95 --- /dev/null +++ b/mini-game/scenes/decor/instructionsUI.tscn @@ -0,0 +1,38 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://mini-game/ressources/font/joystix/ot/joystix monospace.otf" type="DynamicFontData" id=1] +[ext_resource path="res://mini-game/scenes/decor/instructionsUI.gd" type="Script" id=2] + +[sub_resource type="DynamicFont" id=1] +size = 50 +outline_size = 8 +outline_color = Color( 0, 0, 0, 1 ) +font_data = ExtResource( 1 ) + +[node name="instructionsUI" type="Control"] +anchor_right = 1.0 +margin_left = 2.82837 +margin_top = 2.82837 +margin_right = 2.82837 +margin_bottom = 1082.83 +script = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="MarginContainer" type="MarginContainer" parent="."] +margin_left = -2.82837 +margin_top = 291.627 +margin_right = 1918.17 +margin_bottom = 645.627 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="MarginContainer"] +margin_top = 146.0 +margin_right = 1921.0 +margin_bottom = 207.0 +custom_fonts/font = SubResource( 1 ) +text = "Appuyer sur ESPACE pour sauter" +align = 1 diff --git a/mini-game/scenes/decor/start_timer_UI.gd b/mini-game/scenes/decor/start_timer_UI.gd new file mode 100644 index 0000000..328eca7 --- /dev/null +++ b/mini-game/scenes/decor/start_timer_UI.gd @@ -0,0 +1,18 @@ +extends Control + + +onready var label : Label = $MarginContainer/Label + +func _ready(): + Signals.connect("update_timer",self,"update_timer") + hide() + + +func update_timer(score: String): + label.text = score + + +func init(): + update_timer(String(3)) + show() + diff --git a/mini-game/scenes/decor/start_timer_UI.tscn b/mini-game/scenes/decor/start_timer_UI.tscn new file mode 100644 index 0000000..3e5e0df --- /dev/null +++ b/mini-game/scenes/decor/start_timer_UI.tscn @@ -0,0 +1,34 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://mini-game/ressources/font/joystix/ot/joystix monospace.otf" type="DynamicFontData" id=1] +[ext_resource path="res://mini-game/scenes/decor/start_timer_UI.gd" type="Script" id=2] + +[sub_resource type="DynamicFont" id=1] +size = 200 +outline_size = 20 +outline_color = Color( 0, 0, 0, 1 ) +font_data = ExtResource( 1 ) + +[node name="start_timer_UI" type="Control"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_right = 0.00012207 +script = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="MarginContainer" type="MarginContainer" parent="."] +anchor_right = 1.0 +margin_bottom = 370.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="MarginContainer"] +margin_top = 64.0 +margin_right = 1920.0 +margin_bottom = 305.0 +custom_fonts/font = SubResource( 1 ) +text = "9" +align = 1