Added missing files for mini-game
This commit is contained in:
parent
42c27a5e5f
commit
e894808313
4 changed files with 124 additions and 0 deletions
34
mini-game/scenes/decor/instructionsUI.gd
Normal file
34
mini-game/scenes/decor/instructionsUI.gd
Normal file
|
@ -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()
|
38
mini-game/scenes/decor/instructionsUI.tscn
Normal file
38
mini-game/scenes/decor/instructionsUI.tscn
Normal file
|
@ -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
|
18
mini-game/scenes/decor/start_timer_UI.gd
Normal file
18
mini-game/scenes/decor/start_timer_UI.gd
Normal file
|
@ -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()
|
||||
|
34
mini-game/scenes/decor/start_timer_UI.tscn
Normal file
34
mini-game/scenes/decor/start_timer_UI.tscn
Normal file
|
@ -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
|
Loading…
Reference in a new issue