diff --git a/godot/Main.gd b/godot/Main.gd index 302be21..d92b7d2 100644 --- a/godot/Main.gd +++ b/godot/Main.gd @@ -1,10 +1,18 @@ extends Node -onready var player_vars = get_node("/root/PlayerVariables") -# Called when the node enters the scene tree for the first time. -#func _ready(): -# pass +onready var player_vars = get_node("/root/PlayerVariables") +onready var game_time = get_node("/root/GameTimer") + + +func _ready(): + + # Keep everything hidden but bring up the starting menu + + game_time.paused = 1 + $"%UI".visible = false + $"%Landscape".visible = false + $"%StartScreen".visible = true #func _process(delta): # pass diff --git a/godot/Main.tscn b/godot/Main.tscn index b111059..1f68def 100644 --- a/godot/Main.tscn +++ b/godot/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=32 format=2] +[gd_scene load_steps=33 format=2] [ext_resource path="res://MainCamera.gd" type="Script" id=1] [ext_resource path="res://Pupils.gd" type="Script" id=2] @@ -18,6 +18,7 @@ [ext_resource path="res://Dialogs/Josephine1.gd" type="Script" id=16] [ext_resource path="res://Dialogs.gd" type="Script" id=17] [ext_resource path="res://Assets/Jellee-Bold.ttf" type="DynamicFontData" id=18] +[ext_resource path="res://StartScreen.gd" type="Script" id=19] [sub_resource type="DynamicFont" id=1] size = 32 @@ -76,7 +77,7 @@ bg_color = Color( 0.364706, 0.364706, 0.364706, 1 ) [node name="Main" type="Node"] script = ExtResource( 5 ) -[node name="ColorRect" type="ColorRect" parent="."] +[node name="BlueBackground" type="ColorRect" parent="."] margin_left = -6301.29 margin_top = -4096.0 margin_right = 6909.71 @@ -89,6 +90,8 @@ __meta__ = { } [node name="Landscape" type="Node2D" parent="."] +unique_name_in_owner = true +visible = false position = Vector2( -500, -1200 ) [node name="GrassFloor" type="TileMap" parent="Landscape"] @@ -324,13 +327,30 @@ texture = ExtResource( 3 ) offset = Vector2( 4, 4 ) [node name="MainCamera" type="Camera2D" parent="."] +unique_name_in_owner = true position = Vector2( 901.653, 1291.88 ) offset = Vector2( -100, -900 ) current = true zoom = Vector2( 1.5, 1.5 ) script = ExtResource( 1 ) +[node name="StartScreen" type="CanvasLayer" parent="."] +unique_name_in_owner = true +script = ExtResource( 19 ) + +[node name="StartGame" type="Button" parent="StartScreen"] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -41.0 +margin_top = -22.0 +margin_right = 41.0 +margin_bottom = 22.0 +text = "Start" + [node name="UI" type="CanvasLayer" parent="."] +unique_name_in_owner = true script = ExtResource( 10 ) [node name="Dialogs" type="Node" parent="UI"] @@ -383,9 +403,6 @@ margin_top = 12.2021 margin_right = 38.2957 margin_bottom = 32.2021 text = "||" -__meta__ = { -"_edit_use_anchors_": false -} [node name="RatingTitle" type="Label" parent="UI/MainMenu"] anchor_top = 1.0 @@ -606,65 +623,71 @@ __meta__ = { } [node name="Bars" type="Control" parent="UI/MainMenu"] -margin_right = 40.0 -margin_bottom = 40.0 -__meta__ = { -"_edit_use_anchors_": false -} +margin_left = 1724.0 +margin_top = 854.0 +margin_right = 1896.0 +margin_bottom = 1068.0 [node name="PupilBar" type="ProgressBar" parent="UI/MainMenu/Bars"] -margin_left = 1784.6 -margin_top = 1061.48 -margin_right = 1908.6 -margin_bottom = 1080.48 +margin_left = 95.4001 +margin_top = 164.25 +margin_right = 219.4 +margin_bottom = 183.25 rect_rotation = 270.0 custom_styles/fg = SubResource( 7 ) percent_visible = false __meta__ = { +"_edit_lock_": true, "_edit_use_anchors_": false } [node name="TeacherBar" type="ProgressBar" parent="UI/MainMenu/Bars"] -margin_left = 1821.78 -margin_top = 1061.23 -margin_right = 1945.78 -margin_bottom = 1080.23 +margin_left = 132.58 +margin_top = 164.0 +margin_right = 256.58 +margin_bottom = 183.0 rect_rotation = 270.0 custom_styles/fg = SubResource( 7 ) percent_visible = false __meta__ = { +"_edit_lock_": true, "_edit_use_anchors_": false } [node name="PBar" type="Label" parent="UI/MainMenu/Bars"] anchor_top = 1.0 anchor_bottom = 1.0 -margin_left = 1783.85 -margin_top = 849.524 -margin_right = 1807.85 -margin_bottom = 888.524 +margin_left = 94.6501 +margin_top = -47.7061 +margin_right = 118.65 +margin_bottom = -8.70605 custom_fonts/font = SubResource( 1 ) text = "P" __meta__ = { -"_edit_use_anchors_": false +"_edit_lock_": true } [node name="TBar" type="Label" parent="UI/MainMenu/Bars"] anchor_top = 1.0 anchor_bottom = 1.0 -margin_left = 1821.95 -margin_top = 849.524 -margin_right = 1845.95 -margin_bottom = 888.524 +margin_left = 132.75 +margin_top = -47.7061 +margin_right = 156.75 +margin_bottom = -8.70605 custom_fonts/font = SubResource( 1 ) text = "T" __meta__ = { +"_edit_lock_": true, "_edit_use_anchors_": false } [node name="Line2D" type="Line2D" parent="UI/MainMenu/Bars"] +position = Vector2( -1689.2, -897.23 ) points = PoolVector2Array( 1773.2, 998.934, 1851.95, 998.934 ) width = 4.0 +__meta__ = { +"_edit_lock_": true +} [node name="PausedRect" type="ColorRect" parent="UI"] visible = false @@ -1768,6 +1791,7 @@ script = ExtResource( 6 ) [node name="ClassTeachers" type="Node" parent="."] script = ExtResource( 7 ) +[connection signal="pressed" from="StartScreen/StartGame" to="StartScreen" method="_on_StartGame_pressed"] [connection signal="pressed" from="UI/MainMenu/SpeedOne" to="UI" method="_on_SpeedOne_pressed"] [connection signal="pressed" from="UI/MainMenu/SpeedThree" to="UI" method="_on_SpeedThree_pressed"] [connection signal="pressed" from="UI/MainMenu/SpeedTwo" to="UI" method="_on_SpeedTwo_pressed"] diff --git a/godot/StartScreen.gd b/godot/StartScreen.gd new file mode 100644 index 0000000..60f9533 --- /dev/null +++ b/godot/StartScreen.gd @@ -0,0 +1,14 @@ +extends CanvasLayer + +onready var game_time = get_node("/root/GameTimer") + + +func _ready(): + pass + + +func _on_StartGame_pressed(): + game_time.paused = 0 + $"%StartScreen".visible = false + $"%UI".visible = true + $"%Landscape".visible = true diff --git a/schoolgame.wiki b/schoolgame.wiki new file mode 160000 index 0000000..ef635a7 --- /dev/null +++ b/schoolgame.wiki @@ -0,0 +1 @@ +Subproject commit ef635a79e93b4a645b6fe2e193bdc959c937e1c1