From f50997b98fddd7b45bf51629f052b7cfa0f984ab Mon Sep 17 00:00:00 2001 From: OnlyMares Date: Sun, 5 Mar 2023 03:52:13 -0600 Subject: [PATCH] Nightly push -added beginnings of UI --- .godot/editor/create_recent.Node | 9 ++++- .godot/editor/editor_layout.cfg | 4 +- .godot/editor/filesystem_cache8 | 29 +++++++------- .godot/editor/filesystem_update4 | 1 + .godot/editor/project_metadata.cfg | 6 +-- .godot/editor/recent_dirs | 2 +- .godot/editor/script_editor_cache.cfg | 6 +-- .godot/uid_cache.bin | Bin 468 -> 550 bytes Scenes/UI/ingame_ui.tscn | 20 +++++++++- Scenes/UI/upgrades.tscn | 54 ++++++++++++++++++++++++++ Scripts/game_world.gd | 14 ++++--- 11 files changed, 114 insertions(+), 31 deletions(-) create mode 100644 Scenes/UI/upgrades.tscn diff --git a/.godot/editor/create_recent.Node b/.godot/editor/create_recent.Node index 3fa6923..cfe456a 100644 --- a/.godot/editor/create_recent.Node +++ b/.godot/editor/create_recent.Node @@ -1,5 +1,12 @@ -TextureButton +Button +HBoxContainer +Panel +CanvasLayer VBoxContainer +ScrollContainer +Control +AnimationPlayer +TextureButton Node2D Sprite2D CollisionShape2D diff --git a/.godot/editor/editor_layout.cfg b/.godot/editor/editor_layout.cfg index b2a5b45..cec94f0 100644 --- a/.godot/editor/editor_layout.cfg +++ b/.godot/editor/editor_layout.cfg @@ -14,11 +14,11 @@ dock_split_1=0 dock_split_4=0 dock_2="FileSystem" dock_3="Scene,Import" -dock_5="Inspector,Node,History,Commit (15)" +dock_5="Inspector,Node,History,Commit (11)" [EditorNode] -open_scenes=["res://Scenes/game_world.tscn", "res://Scenes/horse.tscn", "res://Scenes/Cupcakes/cupcake.tscn", "res://Scenes/Locations/yard.tscn", "res://Scenes/UI/ingame_ui.tscn"] +open_scenes=["res://Scenes/game_world.tscn", "res://Scenes/horse.tscn", "res://Scenes/Cupcakes/cupcake.tscn", "res://Scenes/Locations/yard.tscn", "res://Scenes/UI/upgrades.tscn", "res://Scenes/UI/ingame_ui.tscn"] [ScriptEditor] diff --git a/.godot/editor/filesystem_cache8 b/.godot/editor/filesystem_cache8 index 8245b09..cd75924 100644 --- a/.godot/editor/filesystem_cache8 +++ b/.godot/editor/filesystem_cache8 @@ -1,5 +1,5 @@ 2a60927148abd1d33b818b535e306557 -::res://::1677895080 +::res://::1677895091 export_presets.cfg::TextFile::-1::1677836748::0::1::::<><>:: README.md::TextFile::-1::1677829846::0::1::::<><>:: ::res://addons/::1677750379 @@ -18,21 +18,22 @@ Cupcake.png::CompressedTexture2D::2257367495948376976::1677756335::1677787255::1 ::res://Art/Locations/::1677787260 yard1.png::CompressedTexture2D::4372226739663751514::1677759042::1677787260::1::::<><>:: ::res://Art/Upgrades/::1677787246 -::res://Scenes/::1677894922 -game_world.tscn::PackedScene::7981802964863433317::1677894922::0::1::::<><>::res://Scripts/game_world.gd<>res://Scripts/Cupcake Spawn Timer.gd<>uid://dswkgkor3yejo<>res://Scripts/PlayArea.gd -horse.tscn::PackedScene::8568825373134700876::1677894219::0::1::::<><>::res://Scripts/horse.gd<>uid://cbpvwmngdb4ke -::res://Scenes/Cupcakes/::1677894219 -cupcake.tscn::PackedScene::8468695979515826288::1677894219::0::1::::<><>::res://Scripts/Cupcakes/cupcake.gd<>uid://7fqro4fugv8k -::res://Scenes/Locations/::1677894219 -yard.tscn::PackedScene::7883941411178408831::1677894219::0::1::::<><>::uid://b3j662tj6h5vq -::res://Scenes/UI/::1677894219 -ingame_ui.tscn::PackedScene::6815695514927101566::1677894219::0::1::::<><>:: -::res://Scripts/::1677895080 -constVar.gd::GDScript::-1::1677895026::0::1::::<>Node<>:: +::res://Scenes/::1677919864 +game_world.tscn::PackedScene::7981802964863433317::1677919864::0::1::::<><>::res://Scripts/game_world.gd<>res://Scripts/Cupcake Spawn Timer.gd<>uid://dswkgkor3yejo<>res://Scripts/PlayArea.gd +horse.tscn::PackedScene::8568825373134700876::1677919864::0::1::::<><>::res://Scripts/horse.gd<>uid://cbpvwmngdb4ke +::res://Scenes/Cupcakes/::1677919864 +cupcake.tscn::PackedScene::8468695979515826288::1677919864::0::1::::<><>::res://Scripts/Cupcakes/cupcake.gd<>uid://7fqro4fugv8k +::res://Scenes/Locations/::1677919864 +yard.tscn::PackedScene::7883941411178408831::1677919864::0::1::::<><>::uid://b3j662tj6h5vq +::res://Scenes/UI/::1678001506 +ingame_ui.tscn::PackedScene::6815695514927101566::1678001506::0::1::::<><>:: +Upgrades.tscn::PackedScene::5871013436024621816::1678008873::0::1::::<><>:: +::res://Scripts/::1678001506 Cupcake Spawn Timer.gd::GDScript::-1::1677829748::0::1::::<>Timer<>:: -game_world.gd::GDScript::-1::1677894219::0::1::::<>Node2D<>:: -horse.gd::GDScript::-1::1677889419::0::1::::<>CharacterBody2D<>:: +game_world.gd::GDScript::-1::1678001506::0::1::::<>Node2D<>:: +horse.gd::GDScript::-1::1677918740::0::1::::<>CharacterBody2D<>:: PlayArea.gd::GDScript::-1::1677893017::0::1::::<>Area2D<>:: +varConst.gd::GDScript::-1::1677895026::0::1::::<>Node<>:: varVar.gd::GDScript::-1::1677895074::0::1::::<>Node<>:: ::res://Scripts/Cupcakes/::1677890080 cupcake.gd::GDScript::-1::1677890080::0::1::::<>RigidBody2D<>:: diff --git a/.godot/editor/filesystem_update4 b/.godot/editor/filesystem_update4 index 60c4d7d..19c42fc 100644 --- a/.godot/editor/filesystem_update4 +++ b/.godot/editor/filesystem_update4 @@ -9,3 +9,4 @@ res://Scenes/Locations/yard.tscn res://README.md res://Scenes/UI/ingame_ui.tscn res://Scripts/PlayArea.gd +res://Scenes/UI/upgrades.tscn diff --git a/.godot/editor/project_metadata.cfg b/.godot/editor/project_metadata.cfg index f09e8d1..60b637d 100644 --- a/.godot/editor/project_metadata.cfg +++ b/.godot/editor/project_metadata.cfg @@ -11,17 +11,17 @@ run_reload_scripts=true [dialog_bounds] project_settings=Rect2(814, 506, 1120, 920) -editor_settings=Rect2(830, 460, 900, 700) +editor_settings=Rect2(830, 520, 900, 700) search_help=Rect2(640, 390, 1280, 720) export=Rect2(830, 430, 900, 700) [color_picker] -recent_presets=PackedColorArray(0, 0, 0, 1, 0.2, 0.0156863, 0.286275, 0.431373, 0.2, 0.0156863, 0.286275, 1, 0.181189, 0.0715467, 0.241084, 1, 0.16746, 0.0927669, 0.215293, 1, 0.163438, 0.106064, 0.177906, 1, 0.151073, 0.10726, 0.20049, 1, 0.169037, 0.0963807, 0.200651, 1, 0.159178, 0.105531, 0.189929, 1) +recent_presets=PackedColorArray(0.181189, 0.0715467, 0.241084, 1, 0.16746, 0.0927669, 0.215293, 1, 0.163438, 0.106064, 0.177906, 1, 0.151073, 0.10726, 0.20049, 1, 0.169037, 0.0963807, 0.200651, 1, 0.159178, 0.105531, 0.189929, 1, 0.722336, 0.665569, 0.997871, 1, 0.0110876, 0.0110876, 0.0110876, 1, 0.0562916, 0.0562916, 0.0562916, 1) [recent_files] -scenes=["res://Scenes/UI/ingame_ui.tscn", "res://Scenes/Locations/yard.tscn", "res://Scenes/Locations/y.tscn", "res://Scenes/Locations/Yard.tscn", "res://Scenes/Cupcakes/cupcake.tscn", "res://Scenes/horse.tscn", "res://Scenes/game_world.tscn", "res://Scenes/cupcake.tscn"] +scenes=["res://Scenes/UI/ingame_ui.tscn", "res://Scenes/UI/Upgrades.tscn", "res://Scenes/Locations/yard.tscn", "res://Scenes/Locations/y.tscn", "res://Scenes/Locations/Yard.tscn", "res://Scenes/Cupcakes/cupcake.tscn", "res://Scenes/horse.tscn", "res://Scenes/game_world.tscn", "res://Scenes/cupcake.tscn"] scripts=["res://Scripts/PlayArea.gd", "res://README.md", "res://Scripts/Cupcakes/cupcake.gd", "res://Scripts/Cupcake Spawn Timer.gd", "Node", "res://Scripts/game_world.gd", "res://Scripts/horse.gd"] [script_setup] diff --git a/.godot/editor/recent_dirs b/.godot/editor/recent_dirs index 0b1103a..1e319ee 100644 --- a/.godot/editor/recent_dirs +++ b/.godot/editor/recent_dirs @@ -1,5 +1,5 @@ -res://Scripts res://Scenes/UI +res://Scripts /home/shobie/CupcakeRevolution1 res://Scenes/Locations res://Art/Locations diff --git a/.godot/editor/script_editor_cache.cfg b/.godot/editor/script_editor_cache.cfg index 3aa34c6..d3d74f1 100644 --- a/.godot/editor/script_editor_cache.cfg +++ b/.godot/editor/script_editor_cache.cfg @@ -6,7 +6,7 @@ state={ "column": 10, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 10, +"row": 4, "scroll_position": 0.0, "selection": false, "syntax_highlighter": "GDScript" @@ -17,10 +17,10 @@ state={ state={ "bookmarks": PackedInt32Array(), "breakpoints": PackedInt32Array(), -"column": 24, +"column": 0, "folded_lines": Array[int]([]), "h_scroll_position": 0, -"row": 16, +"row": 48, "scroll_position": 0.0, "selection": false, "syntax_highlighter": "GDScript" diff --git a/.godot/uid_cache.bin b/.godot/uid_cache.bin index ded6b41682272e20bb36d1e75759cbf0f951ee31..9f18001c93d7aa1bfc905d42c3f8bc816d8a6d2d 100644 GIT binary patch delta 93 zcmcb@yo`mBcO&Cv#-JZur%mUwR|U#4FfbIQ7F+4-2PdcIr55Xldg_N3q!%Toq!#Oy N6es85Q&@_u5CEjjA7lUk delta 10 RcmZ3+a)p_Zdn4mzMgS5D0~7!N diff --git a/Scenes/UI/ingame_ui.tscn b/Scenes/UI/ingame_ui.tscn index a0c628c..ffe10f5 100644 --- a/Scenes/UI/ingame_ui.tscn +++ b/Scenes/UI/ingame_ui.tscn @@ -1,9 +1,25 @@ [gd_scene format=3 uid="uid://c4dtrk2kooa6q"] -[node name="IngameUI" type="Control"] -layout_mode = 3 +[node name="InGameUI" type="CanvasLayer"] + +[node name="Panel" type="Panel" parent="."] +offset_left = 16.0 +offset_top = 997.0 +offset_right = 1908.0 +offset_bottom = 1066.0 + +[node name="HBoxContainer" type="HBoxContainer" parent="Panel"] +layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 + +[node name="Van" type="Button" parent="Panel/HBoxContainer"] +layout_mode = 2 +text = "Vanil" + +[node name="Choc" type="Button" parent="Panel/HBoxContainer"] +layout_mode = 2 +text = "Choc" diff --git a/Scenes/UI/upgrades.tscn b/Scenes/UI/upgrades.tscn new file mode 100644 index 0000000..0d00e63 --- /dev/null +++ b/Scenes/UI/upgrades.tscn @@ -0,0 +1,54 @@ +[gd_scene format=3 uid="uid://cpv7y67qtmino"] + +[node name="Upgrades" type="CanvasLayer"] + +[node name="Anim" type="AnimationPlayer" parent="."] + +[node name="MainPanel" type="Panel" parent="."] +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -813.5 +offset_top = -402.5 +offset_right = 813.5 +offset_bottom = 402.5 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 + +[node name="Close" type="Button" parent="."] +anchors_preset = -1 +anchor_left = 0.927 +anchor_top = 0.126 +anchor_right = 0.927 +anchor_bottom = 0.126 +offset_left = -24.8401 +offset_top = -20.08 +offset_right = 19.1599 +offset_bottom = 26.92 +text = "X" + +[node name="Control" type="Control" parent="."] +layout_mode = 3 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -787.0 +offset_top = -380.0 +offset_right = 794.0 +offset_bottom = 379.0 + +[node name="ScrollContainer" type="ScrollContainer" parent="Control"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="Control/ScrollContainer"] +layout_mode = 2 diff --git a/Scripts/game_world.gd b/Scripts/game_world.gd index 764464a..cac1848 100644 --- a/Scripts/game_world.gd +++ b/Scripts/game_world.gd @@ -1,26 +1,29 @@ extends Node2D -var spawn +var inGameUI = preload("res://Scenes/UI/ingame_ui.tscn") +var upgradeUI = preload("res://Scenes/UI/upgrades.tscn") var location = preload("res://Scenes/Locations/yard.tscn") var horse_scene = preload("res://Scenes/horse.tscn") var horse = preload("res://Scripts/horse.gd") var horse_instance +var IGUI var mouse_position = Vector2.ZERO var ccVanilla = preload("res://Scenes/Cupcakes/cupcake.tscn") var ccvan = ccVanilla.instantiate() var ccChocolate var ccchoc -var randX -var randY var ccSpawnRate = 25 var ccCount = 0 var ccMaxOnScreen = 2000 func _ready(): + var spawn horse_instance = horse_scene.instantiate() spawn = location.instantiate() + IGUI = inGameUI.instantiate() $Location.add_child(spawn) add_child(horse_instance) + add_child(IGUI) func _process(delta): @@ -28,6 +31,8 @@ func _process(delta): horse_instance.position = mouse_position func spawnCupcakes(): + var randX + var randY randomize() if ccCount <= ccMaxOnScreen: for i in range(ccSpawnRate): @@ -37,8 +42,7 @@ func spawnCupcakes(): $PlayArea.add_child(ccvan.duplicate()) ccCount = ccCount + 25 - - + func collectCupcakes(): pass