-
Notifications
You must be signed in to change notification settings - Fork 0
/
Video3.tscn
84 lines (70 loc) · 2.49 KB
/
Video3.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
[gd_scene load_steps=6 format=2]
[ext_resource path="res://vid3.webm" type="VideoStream" id=1]
[ext_resource path="res://Resources/Menus/Back.png" type="Texture" id=2]
[ext_resource path="res://NerkoOne-Regular.ttf" type="DynamicFontData" id=3]
[sub_resource type="GDScript" id=1]
script/source = "extends Control
var gold_medal := 300.0
var silver_medal := 450.0
var bronze_medal := 600.0
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func get_difficult_medal(medal):
return medal * (Global.difficulty + 1)
func get_medal_name():
if Global.time_played <= get_difficult_medal(gold_medal):
return \"GOLD\"
if Global.time_played <= get_difficult_medal(silver_medal):
return \"SILVER\"
if Global.time_played <= get_difficult_medal(bronze_medal):
return \"BRONZE\"
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
$Medal.text = \"Medals: \\n\\t gold: {gold}s \\n\\t silver: {silver}s \\n\\t bronze: {bronze}s\\n\\nYour Time: {time} - {medal}!\".format(
{\"gold\": get_difficult_medal(gold_medal), \"silver\": get_difficult_medal(silver_medal), \"bronze\": get_difficult_medal(bronze_medal), \"time\" : Global.time_played, \"medal\" : get_medal_name()})
func _on_VideoPlayer_finished():
get_tree().change_scene(\"res://Scenes/Game.tscn\")
func _on_TextureButton_pressed():
get_tree().change_scene(\"res://Scenes/Game.tscn\")
"
[sub_resource type="DynamicFont" id=2]
size = 64
outline_size = 2
outline_color = Color( 0, 0, 0, 1 )
font_data = ExtResource( 3 )
[node name="Control" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = SubResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VideoPlayer" type="VideoPlayer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
stream = ExtResource( 1 )
autoplay = true
buffering_msec = 1000
bus = "Music"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureButton" type="TextureButton" parent="."]
margin_left = 1667.19
margin_top = 914.021
margin_right = 1707.19
margin_bottom = 954.021
texture_normal = ExtResource( 2 )
[node name="Medal" type="Label" parent="."]
margin_left = 768.0
margin_top = 64.0
margin_right = 808.0
margin_bottom = 78.0
custom_fonts/font = SubResource( 2 )
text = "Medal"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="finished" from="VideoPlayer" to="." method="_on_VideoPlayer_finished"]
[connection signal="pressed" from="TextureButton" to="." method="_on_TextureButton_pressed"]