From 4e1edaf8d8dc6fe7dc3ea61c74a484de9cc15b71 Mon Sep 17 00:00:00 2001 From: Fusselkater Date: Thu, 21 Jul 2022 19:21:29 +0200 Subject: [PATCH] add menu --- common/global_state.gd | 2 + project.godot | 2 +- scenes/levels/credits/credits.gd | 6 +- scenes/levels/credits/credits.tscn | 9 ++- scenes/menu/assets/cloud1.png | Bin 0 -> 3141 bytes scenes/menu/assets/cloud1.png.import | 35 +++++++++ scenes/menu/assets/cloud2.png | Bin 0 -> 4284 bytes scenes/menu/assets/cloud2.png.import | 35 +++++++++ scenes/menu/assets/ui/button_normal.svg | 68 ++++++++++++++++++ .../menu/assets/ui/button_normal.svg.import | 35 +++++++++ scenes/menu/assets/ui/button_pressed.svg | 66 +++++++++++++++++ .../menu/assets/ui/button_pressed.svg.import | 35 +++++++++ scenes/menu/assets/ui/button_selected.svg | 68 ++++++++++++++++++ .../menu/assets/ui/button_selected.svg.import | 35 +++++++++ scenes/menu/button.gd | 12 ++++ scenes/menu/button.tscn | 34 +++++++++ scenes/menu/menu.gd | 12 ++++ scenes/menu/menu.tscn | 64 +++++++++++++++++ 18 files changed, 514 insertions(+), 4 deletions(-) create mode 100644 scenes/menu/assets/cloud1.png create mode 100644 scenes/menu/assets/cloud1.png.import create mode 100644 scenes/menu/assets/cloud2.png create mode 100644 scenes/menu/assets/cloud2.png.import create mode 100644 scenes/menu/assets/ui/button_normal.svg create mode 100644 scenes/menu/assets/ui/button_normal.svg.import create mode 100644 scenes/menu/assets/ui/button_pressed.svg create mode 100644 scenes/menu/assets/ui/button_pressed.svg.import create mode 100644 scenes/menu/assets/ui/button_selected.svg create mode 100644 scenes/menu/assets/ui/button_selected.svg.import create mode 100644 scenes/menu/button.gd create mode 100644 scenes/menu/button.tscn create mode 100644 scenes/menu/menu.gd create mode 100644 scenes/menu/menu.tscn diff --git a/common/global_state.gd b/common/global_state.gd index cb75f8a..270a8bd 100644 --- a/common/global_state.gd +++ b/common/global_state.gd @@ -11,3 +11,5 @@ var coins = 0 var health = 100 var player : KinematicBody2D = null + +const MENU_SCENE = "res://scenes/menu/menu.tscn" diff --git a/project.godot b/project.godot index a13d0b8..1bc2049 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=4 [application] config/name="Flopsy the Dog" -run/main_scene="res://scenes/main.tscn" +run/main_scene="res://scenes/menu/menu.tscn" config/icon="res://common/player_head.png" [autoload] diff --git a/scenes/levels/credits/credits.gd b/scenes/levels/credits/credits.gd index 020909d..712fe86 100644 --- a/scenes/levels/credits/credits.gd +++ b/scenes/levels/credits/credits.gd @@ -4,4 +4,8 @@ func _ready(): $CanvasLayer/CreditsScroller.play("scroll") func _on_CreditsScroller_finished(anim_name): - get_tree().quit() + get_tree().change_scene(GlobalState.MENU_SCENE) + +func _process(delta): + if Input.is_action_just_pressed("ui_cancel"): + get_tree().change_scene(GlobalState.MENU_SCENE) diff --git a/scenes/levels/credits/credits.tscn b/scenes/levels/credits/credits.tscn index 4da5bc2..19e9fe7 100644 --- a/scenes/levels/credits/credits.tscn +++ b/scenes/levels/credits/credits.tscn @@ -25,11 +25,12 @@ tracks/0/keys = { "times": PoolRealArray( 0, 60 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, -"values": [ Vector2( 0, 1080 ), Vector2( 0, -2350 ) ] +"values": [ Vector2( 0, 1080 ), Vector2( 0, -2560 ) ] } [node name="Credits" type="Node2D"] script = ExtResource( 1 ) +bgm_path = "res://scenes/levels/02/assets/interlude.ogg" hud_visible = false clear_color = Color( 0, 0, 0, 1 ) @@ -38,7 +39,7 @@ clear_color = Color( 0, 0, 0, 1 ) [node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer"] margin_top = 1080.0 margin_right = 1925.0 -margin_bottom = 3430.0 +margin_bottom = 3640.0 custom_fonts/bold_font = SubResource( 1 ) custom_fonts/normal_font = SubResource( 2 ) bbcode_enabled = true @@ -56,6 +57,8 @@ Fusselkater [b]Testing[/b] xtristrix oile +Giggles +Snuggo [b]Assets[/b] @@ -97,6 +100,8 @@ Fusselkater Testing xtristrix oile +Giggles +Snuggo Assets diff --git a/scenes/menu/assets/cloud1.png b/scenes/menu/assets/cloud1.png new file mode 100644 index 0000000000000000000000000000000000000000..2f038fa3e264bff09c1de256af58f43fdcb2de6b GIT binary patch literal 3141 zcmeHJ_g7Qd7C!d^NkACDLN$~b2S%Nt43Q0WqJn@D zD|W;J2uLo2B+?Zu3@xFT0HFi|q}&(Z5APp%{`l59>+El@@9b~wwbwd(eP>+Bjw(tz zN&oA{mu>*U?ah)S~|+yJbgkT=Ywd+K7Ips(cy~ zl*P?B0kG=U-ktXDaa~ir-3bL&F#V6#kwblG82dQ2>xhm%qIJ=emryeqc384|N9GVa zJ|@Oixo&Cy@5=EKxmH8V(GP7ICkv;wo9r=a^rcr}*PUG+wSRGxhcb74ydv4+b~Tnm z)}QNlaHHDo!66?VX;$Q>BhI1)tR&}>)AcL>Q+m8;ZsZcJc_MM_!0yH#wjx9r%B8it zm_F`uBtCFCgfRe)ZhrS;&V9av?jkPjF$9k7M>?)02vyYRgUV>rtJjUiN)X|6lBge@ zzedjj^8U1X!c^TB0Cl28UtAL3thMvPAve1u=}g!Fh$b$F`Dt3iYV_V3scA=_iJdnN zvCAI^tMyIf{j;0UlUDMhiUy##T8#3889_3+@E9UKZB$lqUZvx&3e8M#?2%RblF%K% z&!?Cpu7jLSGITH4D(@3k86pgeQQ^h_JAWMF#Y9V*AvOB^1+>BP77mGLGoJz+V$|hu z0Syxb=UW5(B(u^iPP&nG-%1^P=2qcAnZQP#Apu5_s=fhwm?4`Sh9?r*6@SvOTbv+uYK zUi_k0phmZz*r;>@BlT@-Xrg&Uo1AJ{4bP10-qy3b8)M5-2NCLG?fHU|==YeM4balE z`d$;a!hP_Zh}PBU&YgrpAE%uC+Q3&R%Z?aPUQHPRL%AD|7TZ}qNt_6~&^OiIfnnf_ zbKbMewezE%CR5v3y=CK37>3jRdF>p*hR2+idAF)8UD#Ne)a??o)o7NZm$zVrZF4Cy z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4#wjW!FrJazMI`+ZU{58@O)$c0Q&?vd)W^z3QMjU=f=O2t9H6{&nbF0<=eL8*r1R z0asZ$vwrKlSPH7Eg74 z(uYC|cv)h*4Gz7@c!}?joch0V{8WF;MSZ(M_IGJZ)Lw5`{@ByQ?)LNB*i$i=5qkbi z36=0PD@V+2jsi?r4UlABPv-c(7x;ck|Ly4ilHYFv|FcpakG8h)$;g?P4;E!c9_-yk L-uY~Yf9k&hyN4Fd literal 0 HcmV?d00001 diff --git a/scenes/menu/assets/cloud1.png.import b/scenes/menu/assets/cloud1.png.import new file mode 100644 index 0000000..d8fbe83 --- /dev/null +++ b/scenes/menu/assets/cloud1.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/cloud1.png-0fe2af1d9d1e77db1cb404e8bead9afd.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/menu/assets/cloud1.png" +dest_files=[ "res://.import/cloud1.png-0fe2af1d9d1e77db1cb404e8bead9afd.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/scenes/menu/assets/cloud2.png b/scenes/menu/assets/cloud2.png new file mode 100644 index 0000000000000000000000000000000000000000..a78cf70626d77491750ce4746b810a21e075b70b GIT binary patch literal 4284 zcmZvfd0bP+7RM)n2mul5MqMgV5v@>AQBV;QMXOdJsiLTe!HOa-1Z5X7QJ-4{;!-Lu z5I`$dBtce@CBcP7v~fW|w%~$bgU{2J?wNDXe9!NkN&c8qEZ^l; z7UL}d09GqkEL{VDDKtrE%uV3SEbYxY_%aPy?6Vkv+k8uOD+K`ZF4k(lWhjoT^tb`V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g;&74a~eOuM~m+;naAb7X9X}qVh182U}9Q92KT$h6^9)2MI z6c!h!8kF_Yx*;UN{OL#UV|NFGbIlpW1usR0*z;n-`)IUKj8WZ~686)hRynrU9KmUSrf((&w(6so63#6kIaqMTLJH_Qq_{Bdo2?PCv zn0H?=uy2Vk+i5;PoOFX?<-m9TTO@D2R@Wv>2=w0xTJo*f2STTYH-}Jl?W|zX;&#lv zH;=^ov3JHSaNUMnPuQ{2nYwfmJILECk4=>=f{9@j?FV+=cNGU z(x9rMjyWg$cCs`a^RaDc6C*OcLO(YztR`!j)VDO|*^?$;O3>L7i>yebMtIPFXN`et zh~jGH^gFsWlgBRlm~do8g#kOkwA-Q*ZnWH202pn{4=*58ftKaoXPilZ1kMeY$jEgg zfem25yC1v(8V#P7+|Oa;oBn6{KmSQ`f6NztS|vcIo^dkLK5ZW|PPzbsYQO6Lv7h`i z0G)hp8lV9lyiWpiXfO&%+V8&#u=+YcJnWwUNE)DY`hQiK*%x3NK+6KC>lc2gm=694 zHY&5DZ6yCk=zkSMW439h;j@G%-2h?wh2l4s5+*O0I#lU@0gQtrt;<)yjHM*)?9Y^C zSxM;NYeyvdEdS8a!6S100&K$u_@ouT|F7jkLLS)ixTJp;Jmg6U{q%Ng)-x>Vn~YV2LdeoaGg_gwM_xwSh>u1sc=cqk$(epOP8Mj literal 0 HcmV?d00001 diff --git a/scenes/menu/assets/cloud2.png.import b/scenes/menu/assets/cloud2.png.import new file mode 100644 index 0000000..c5b8601 --- /dev/null +++ b/scenes/menu/assets/cloud2.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/cloud2.png-da45286331c48a611e52e233c726851a.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/menu/assets/cloud2.png" +dest_files=[ "res://.import/cloud2.png-da45286331c48a611e52e233c726851a.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/scenes/menu/assets/ui/button_normal.svg b/scenes/menu/assets/ui/button_normal.svg new file mode 100644 index 0000000..3f17c4b --- /dev/null +++ b/scenes/menu/assets/ui/button_normal.svg @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + diff --git a/scenes/menu/assets/ui/button_normal.svg.import b/scenes/menu/assets/ui/button_normal.svg.import new file mode 100644 index 0000000..e71c34a --- /dev/null +++ b/scenes/menu/assets/ui/button_normal.svg.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/button_normal.svg-6ff2901dbc984c729920dec4abff8045.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/menu/assets/ui/button_normal.svg" +dest_files=[ "res://.import/button_normal.svg-6ff2901dbc984c729920dec4abff8045.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/scenes/menu/assets/ui/button_pressed.svg b/scenes/menu/assets/ui/button_pressed.svg new file mode 100644 index 0000000..741c53a --- /dev/null +++ b/scenes/menu/assets/ui/button_pressed.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + diff --git a/scenes/menu/assets/ui/button_pressed.svg.import b/scenes/menu/assets/ui/button_pressed.svg.import new file mode 100644 index 0000000..da6e74a --- /dev/null +++ b/scenes/menu/assets/ui/button_pressed.svg.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/button_pressed.svg-66a54f8ffc6687cb5f4358307dff97d7.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/menu/assets/ui/button_pressed.svg" +dest_files=[ "res://.import/button_pressed.svg-66a54f8ffc6687cb5f4358307dff97d7.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/scenes/menu/assets/ui/button_selected.svg b/scenes/menu/assets/ui/button_selected.svg new file mode 100644 index 0000000..4688ae6 --- /dev/null +++ b/scenes/menu/assets/ui/button_selected.svg @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + diff --git a/scenes/menu/assets/ui/button_selected.svg.import b/scenes/menu/assets/ui/button_selected.svg.import new file mode 100644 index 0000000..f6d34c7 --- /dev/null +++ b/scenes/menu/assets/ui/button_selected.svg.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/button_selected.svg-0797fd18c0b166d2a9ca0fd029cc2bfb.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/menu/assets/ui/button_selected.svg" +dest_files=[ "res://.import/button_selected.svg-0797fd18c0b166d2a9ca0fd029cc2bfb.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/scenes/menu/button.gd b/scenes/menu/button.gd new file mode 100644 index 0000000..b380307 --- /dev/null +++ b/scenes/menu/button.gd @@ -0,0 +1,12 @@ +extends TextureButton + +export(String) var text = "" + +func _ready(): + $Label.text = text + +func _on_button_down(): + $Label.rect_position.y = 3 + +func _on_button_up(): + $Label.rect_position.y = -1 diff --git a/scenes/menu/button.tscn b/scenes/menu/button.tscn new file mode 100644 index 0000000..d304eac --- /dev/null +++ b/scenes/menu/button.tscn @@ -0,0 +1,34 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://scenes/menu/assets/ui/button_pressed.svg" type="Texture" id=1] +[ext_resource path="res://scenes/menu/assets/ui/button_normal.svg" type="Texture" id=2] +[ext_resource path="res://common/fonts/ComicNeue-Regular.ttf" type="DynamicFontData" id=3] +[ext_resource path="res://scenes/menu/button.gd" type="Script" id=4] + +[sub_resource type="DynamicFont" id=1] +size = 18 +outline_size = 2 +outline_color = Color( 0.427451, 0.329412, 0.227451, 1 ) +font_data = ExtResource( 3 ) + +[node name="AdventureButton" type="TextureButton"] +margin_left = 910.0 +margin_top = 490.0 +margin_right = 1100.0 +margin_bottom = 539.0 +texture_normal = ExtResource( 2 ) +texture_pressed = ExtResource( 1 ) +script = ExtResource( 4 ) + +[node name="Label" type="Label" parent="."] +margin_top = -1.0 +margin_right = 190.0 +margin_bottom = 48.0 +custom_colors/font_color = Color( 0.717647, 0.568627, 0.415686, 1 ) +custom_fonts/font = SubResource( 1 ) +text = "Start Game" +align = 1 +valign = 1 + +[connection signal="button_down" from="." to="." method="_on_button_down"] +[connection signal="button_up" from="." to="." method="_on_button_up"] diff --git a/scenes/menu/menu.gd b/scenes/menu/menu.gd new file mode 100644 index 0000000..dbdfd6f --- /dev/null +++ b/scenes/menu/menu.gd @@ -0,0 +1,12 @@ +extends Control +export(String, FILE, "*.ogg") var bgm_path +export(String, FILE, "*.tscn") var next_level + +func _ready(): + VisualServer.set_default_clear_color("cfeffc") + +func _on_button_play_pressed(): + get_tree().change_scene(next_level) + +func _on_button_quit_pressed(): + get_tree().quit() diff --git a/scenes/menu/menu.tscn b/scenes/menu/menu.tscn new file mode 100644 index 0000000..0230eef --- /dev/null +++ b/scenes/menu/menu.tscn @@ -0,0 +1,64 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://scenes/menu/menu.gd" type="Script" id=1] +[ext_resource path="res://common/tiles/grasland.tres" type="TileSet" id=2] +[ext_resource path="res://scenes/menu/assets/cloud1.png" type="Texture" id=3] +[ext_resource path="res://scenes/menu/assets/cloud2.png" type="Texture" id=4] +[ext_resource path="res://scenes/menu/button.tscn" type="PackedScene" id=5] +[ext_resource path="res://objects/characters/flopsy/flopsy.tscn" type="PackedScene" id=6] + +[node name="Menu" type="Control"] +script = ExtResource( 1 ) +next_level = "res://scenes/main.tscn" + +[node name="Cloud1" type="TextureRect" parent="."] +margin_right = 1925.0 +margin_bottom = 770.0 +texture = ExtResource( 3 ) +expand = true +stretch_mode = 5 + +[node name="Cloud2" type="TextureRect" parent="."] +margin_top = 245.0 +margin_right = 1925.0 +margin_bottom = 1050.0 +texture = ExtResource( 4 ) +expand = true +stretch_mode = 5 + +[node name="TileMap" type="TileMap" parent="."] +tile_set = ExtResource( 2 ) +collision_layer = 4 +collision_mask = 0 +format = 1 +tile_data = PoolIntArray( 983037, 4, 0, 983038, 4, 0, 983039, 4, 0, 917504, 4, 0, 917505, 4, 0, 917506, 4, 0, 917507, 4, 0, 917508, 4, 0, 917509, 4, 0, 917510, 4, 0, 917511, 4, 0, 917512, 4, 0, 917513, 4, 0, 917514, 4, 0, 917515, 4, 0, 917516, 4, 0, 917517, 4, 0, 917518, 4, 0, 917519, 4, 0, 917520, 4, 0, 917521, 4, 0, 917522, 4, 0, 917523, 4, 0, 917524, 4, 0, 917525, 4, 0, 917526, 4, 0, 917527, 4, 0, 917528, 4, 0, 917529, 4, 0, 917530, 4, 0, 917531, 4, 0, 917532, 4, 0, 917533, 4, 0, 917534, 4, 0, 917535, 4, 0, 917536, 4, 0, 1048573, 5, 0, 1048574, 5, 0, 1048575, 5, 0, 983040, 5, 0, 983041, 5, 0, 983042, 5, 0, 983043, 5, 0, 983044, 5, 0, 983045, 5, 0, 983046, 5, 0, 983047, 5, 0, 983048, 5, 0, 983049, 5, 0, 983050, 5, 0, 983051, 5, 0, 983052, 5, 0, 983053, 5, 0, 983054, 5, 0, 983055, 5, 0, 983056, 5, 0, 983057, 5, 0, 983058, 5, 0, 983059, 5, 0, 983060, 5, 0, 983061, 5, 0, 983062, 5, 0, 983063, 5, 0, 983064, 5, 0, 983065, 5, 0, 983066, 5, 0, 983067, 5, 0, 983068, 5, 0, 983069, 5, 0, 983070, 5, 0, 983071, 5, 0, 983072, 5, 0, 1114109, 5, 0, 1114110, 5, 0, 1114111, 5, 0, 1048576, 5, 0, 1048577, 5, 0, 1048578, 5, 0, 1048579, 5, 0, 1048580, 5, 0, 1048581, 5, 0, 1048582, 5, 0, 1048583, 5, 0, 1048584, 5, 0, 1048585, 5, 0, 1048586, 5, 0, 1048587, 5, 0, 1048588, 5, 0, 1048589, 5, 0, 1048590, 5, 0, 1048591, 5, 0, 1048592, 5, 0, 1048593, 5, 0, 1048594, 5, 0, 1048595, 5, 0, 1048596, 5, 0, 1048597, 5, 0, 1048598, 5, 0, 1048599, 5, 0, 1048600, 5, 0, 1048601, 5, 0, 1048602, 5, 0, 1048603, 5, 0, 1048604, 5, 0, 1048605, 5, 0, 1048606, 5, 0, 1048607, 5, 0, 1048608, 5, 0, 1179645, 5, 0, 1179646, 5, 0, 1179647, 5, 0, 1114112, 5, 0, 1114113, 5, 0, 1114114, 5, 0, 1114115, 5, 0, 1114116, 5, 0, 1114117, 5, 0, 1114118, 5, 0, 1114119, 5, 0, 1114120, 5, 0, 1114121, 5, 0, 1114122, 5, 0, 1114123, 5, 0, 1114124, 5, 0, 1114125, 5, 0, 1114126, 5, 0, 1114127, 5, 0, 1114128, 5, 0, 1114129, 5, 0, 1114130, 5, 0, 1114131, 5, 0, 1114132, 5, 0, 1114133, 5, 0, 1114134, 5, 0, 1114135, 5, 0, 1114136, 5, 0, 1114137, 5, 0, 1114138, 5, 0, 1114139, 5, 0, 1114140, 5, 0, 1114141, 5, 0, 1114142, 5, 0, 1114143, 5, 0, 1114144, 5, 0 ) + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = 865.0 +margin_top = 489.0 +margin_right = 1055.0 +margin_bottom = 591.0 + +[node name="button_play" parent="VBoxContainer" instance=ExtResource( 5 )] +margin_left = 0.0 +margin_top = 0.0 +margin_right = 190.0 +margin_bottom = 49.0 +text = "Start Game" + +[node name="button_quit" parent="VBoxContainer" instance=ExtResource( 5 )] +margin_left = 0.0 +margin_top = 53.0 +margin_right = 190.0 +margin_bottom = 102.0 +text = "Quit Game" + +[node name="Flopsy" parent="." instance=ExtResource( 6 )] +position = Vector2( 271, 671 ) + +[connection signal="pressed" from="VBoxContainer/button_play" to="." method="_on_button_play_pressed"] +[connection signal="pressed" from="VBoxContainer/button_quit" to="." method="_on_button_quit_pressed"]