It's a game! (kinda)

-added cupcake counting system
-added basic shop with one working upgrade, one benign upgrade, and one broken upgrade
-added proper UI basics
-added right click to toggle attached horse (buggy)
main
OnlyMares 2 years ago
parent f50997b98f
commit e04046b4b4

@ -1,16 +1,22 @@
Button
HBoxContainer HBoxContainer
TextureRect
Control
Sprite2D
Label
Button
GridContainer
ItemList
VScrollBar
VBoxContainer
Panel Panel
CollisionShape2D
CollisionPolygon2D
Node2D
Area2D
CanvasLayer CanvasLayer
VBoxContainer
ScrollContainer ScrollContainer
Control
AnimationPlayer AnimationPlayer
TextureButton TextureButton
Node2D
Sprite2D
CollisionShape2D
Area2D
Timer Timer
RigidBody2D RigidBody2D
Marker2D Marker2D

@ -14,7 +14,7 @@ dock_split_1=0
dock_split_4=0 dock_split_4=0
dock_2="FileSystem" dock_2="FileSystem"
dock_3="Scene,Import" dock_3="Scene,Import"
dock_5="Inspector,Node,History,Commit (11)" dock_5="Inspector,Node,History,Commit (20)"
[EditorNode] [EditorNode]
@ -22,7 +22,7 @@ open_scenes=["res://Scenes/game_world.tscn", "res://Scenes/horse.tscn", "res://S
[ScriptEditor] [ScriptEditor]
open_scripts=["res://Scripts/Cupcake Spawn Timer.gd", "res://Scripts/Cupcakes/cupcake.gd", "res://Scripts/game_world.gd", "res://Scripts/horse.gd", "res://Scripts/PlayArea.gd", "res://README.md"] open_scripts=["res://Scripts/Cupcake Spawn Timer.gd", "res://Scripts/Cupcakes/cupcake.gd", "res://Scripts/game_world.gd", "res://Scripts/horse.gd", "res://Scripts/ingame_ui.gd", "res://Scripts/PlayArea.gd", "res://README.md", "res://Scripts/upgrades.gd", "res://Scripts/varConst.gd", "res://Scripts/varVar.gd"]
open_help=["Node"] open_help=["Node"]
script_split_offset=70 script_split_offset=70
list_split_offset=0 list_split_offset=0

@ -10,3 +10,6 @@ res://README.md
res://Scenes/UI/ingame_ui.tscn res://Scenes/UI/ingame_ui.tscn
res://Scripts/PlayArea.gd res://Scripts/PlayArea.gd
res://Scenes/UI/upgrades.tscn res://Scenes/UI/upgrades.tscn
res://Scripts/upgrades.gd
res://Scripts/ingame_ui.gd
res://Scripts/varVar.gd

@ -1,3 +1,3 @@
[folding] [folding]
sections_unfolded=PackedStringArray() sections_unfolded=PackedStringArray("Resource")

@ -8,7 +8,7 @@ Anim={
"grid_snap_active": false, "grid_snap_active": false,
"grid_step": Vector2(8, 8), "grid_step": Vector2(8, 8),
"grid_visibility": 1, "grid_visibility": 1,
"ofs": Vector2(-605.908, -556.88), "ofs": Vector2(-531.369, -614.342),
"primary_grid_steps": 8, "primary_grid_steps": 8,
"show_edit_locks": true, "show_edit_locks": true,
"show_guides": true, "show_guides": true,

@ -1,5 +1,5 @@
[folding] [folding]
node_unfolds=[NodePath("."), PackedStringArray("Transform", "Material", "Texture", "Ordering", "Visibility", "Editor Description", "Process", "ccVanilla"), NodePath("Location"), PackedStringArray("Visibility"), NodePath("PlayArea"), PackedStringArray("Input", "Collision"), NodePath("PlayArea/Cupcake"), PackedStringArray("Collision"), NodePath("PlayArea/CollisionShape2D"), PackedStringArray("Transform", "Visibility")] node_unfolds=[NodePath("."), PackedStringArray("Transform", "Material", "Texture", "Ordering", "Visibility", "Editor Description", "Process", "ccVanilla"), NodePath("Location"), PackedStringArray("Visibility"), NodePath("Upgrades"), PackedStringArray("Layer"), NodePath("Cupcakes/Cupcake"), PackedStringArray("Collision"), NodePath("PlayArea"), PackedStringArray("Input", "Collision", "Visibility"), NodePath("PlayArea/CollisionShape2D"), PackedStringArray("Transform", "shape")]
resource_unfolds=["res://Scenes/game_world.tscn::RectangleShape2D_sh03e", PackedStringArray()] resource_unfolds=["res://Scenes/game_world.tscn::RectangleShape2D_g5fj2", PackedStringArray()]
nodes_folded=[] nodes_folded=[]

@ -10,10 +10,10 @@ run_reload_scripts=true
[dialog_bounds] [dialog_bounds]
project_settings=Rect2(814, 506, 1120, 920) project_settings=Rect2(814, 520, 1120, 920)
editor_settings=Rect2(830, 520, 900, 700) editor_settings=Rect2(830, 520, 900, 700)
search_help=Rect2(640, 390, 1280, 720) search_help=Rect2(640, 390, 1280, 720)
export=Rect2(830, 430, 900, 700) export=Rect2(830, 460, 900, 700)
[color_picker] [color_picker]
@ -22,7 +22,7 @@ recent_presets=PackedColorArray(0.181189, 0.0715467, 0.241084, 1, 0.16746, 0.092
[recent_files] [recent_files]
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"] 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"] scripts=["res://Scripts/varConst.gd", "res://Scripts/varVar.gd", "res://Scripts/ingame_ui.gd", "res://Scripts/upgrades.gd", "res://Scripts/PlayArea.gd", "res://README.md", "res://Scripts/Cupcakes/cupcake.gd", "res://Scripts/Cupcake Spawn Timer.gd", "Node", "res://Scripts/game_world.gd"]
[script_setup] [script_setup]

@ -3,10 +3,10 @@
state={ state={
"bookmarks": PackedInt32Array(), "bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(), "breakpoints": PackedInt32Array(),
"column": 10, "column": 21,
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 0,
"row": 4, "row": 17,
"scroll_position": 0.0, "scroll_position": 0.0,
"selection": false, "selection": false,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"
@ -17,10 +17,10 @@ state={
state={ state={
"bookmarks": PackedInt32Array(), "bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(), "breakpoints": PackedInt32Array(),
"column": 0, "column": 31,
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 0,
"row": 48, "row": 107,
"scroll_position": 0.0, "scroll_position": 0.0,
"selection": false, "selection": false,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"
@ -48,7 +48,7 @@ state={
"column": 0, "column": 0,
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 0,
"row": 13, "row": 25,
"scroll_position": 0.0, "scroll_position": 0.0,
"selection": false, "selection": false,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"
@ -73,10 +73,74 @@ state={
state={ state={
"bookmarks": PackedInt32Array(), "bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(), "breakpoints": PackedInt32Array(),
"column": 21, "column": 0,
"folded_lines": Array[int]([]),
"h_scroll_position": 0,
"row": 12,
"scroll_position": 0.0,
"selection": false,
"syntax_highlighter": "GDScript"
}
[res://Scripts/upgrades.gd]
state={
"bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(),
"column": 0,
"folded_lines": Array[int]([]),
"h_scroll_position": 0,
"row": 21,
"scroll_position": 0.0,
"selection": true,
"selection_from_column": 0,
"selection_from_line": 21,
"selection_to_column": 28,
"selection_to_line": 22,
"syntax_highlighter": "GDScript"
}
[res://Scripts/ingame_ui.gd]
state={
"bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(),
"column": 10,
"folded_lines": Array[int]([]),
"h_scroll_position": 0,
"row": 24,
"scroll_position": 0.0,
"selection": false,
"syntax_highlighter": "GDScript"
}
[res://Scripts/varVar.gd]
state={
"bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(),
"column": 0,
"folded_lines": Array[int]([]),
"h_scroll_position": 0,
"row": 4,
"scroll_position": 0.0,
"selection": true,
"selection_from_column": 0,
"selection_from_line": 4,
"selection_to_column": 17,
"selection_to_line": 5,
"syntax_highlighter": "GDScript"
}
[res://Scripts/varConst.gd]
state={
"bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(),
"column": 0,
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 0,
"row": 15, "row": 0,
"scroll_position": 0.0, "scroll_position": 0.0,
"selection": false, "selection": false,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"

@ -22,3 +22,5 @@ texture = ExtResource("1_632he")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]
scale = Vector2(2, 2) scale = Vector2(2, 2)
shape = SubResource("CircleShape2D_svirt") shape = SubResource("CircleShape2D_svirt")
[connection signal="body_exited" from="." to="." method="_on_body_exited"]

@ -1,14 +1,18 @@
[gd_scene format=3 uid="uid://c4dtrk2kooa6q"] [gd_scene load_steps=3 format=3 uid="uid://c4dtrk2kooa6q"]
[ext_resource type="Script" path="res://Scripts/ingame_ui.gd" id="1_q8tnv"]
[ext_resource type="Texture2D" uid="uid://7fqro4fugv8k" path="res://Art/Cupcakes/Cupcake.png" id="1_vkoxt"]
[node name="InGameUI" type="CanvasLayer"] [node name="InGameUI" type="CanvasLayer"]
script = ExtResource("1_q8tnv")
[node name="Panel" type="Panel" parent="."] [node name="Main" type="Panel" parent="."]
offset_left = 16.0 offset_left = 16.0
offset_top = 997.0 offset_top = 997.0
offset_right = 1908.0 offset_right = 1908.0
offset_bottom = 1066.0 offset_bottom = 1066.0
[node name="HBoxContainer" type="HBoxContainer" parent="Panel"] [node name="HBoxContainer" type="HBoxContainer" parent="Main"]
layout_mode = 1 layout_mode = 1
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@ -16,10 +20,54 @@ anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
[node name="Van" type="Button" parent="Panel/HBoxContainer"] [node name="Van" type="Button" parent="Main/HBoxContainer"]
layout_mode = 2 layout_mode = 2
text = "Vanil" icon = ExtResource("1_vkoxt")
icon_alignment = 1
[node name="Choc" type="Button" parent="Panel/HBoxContainer"] [node name="Choc" type="Button" parent="Main/HBoxContainer"]
layout_mode = 2 layout_mode = 2
text = "Choc" text = "Choc"
[node name="Num" type="Panel" parent="."]
clip_children = 1
offset_left = 45.0
offset_top = 15.0
offset_right = 239.0
offset_bottom = 985.0
[node name="VBoxContainer" type="VBoxContainer" parent="Num"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="ccVanNum" type="Label" parent="Num/VBoxContainer"]
layout_mode = 2
text = "0"
[node name="Icons" type="Panel" parent="."]
clip_children = 1
offset_left = 11.0
offset_top = 15.0
offset_right = 43.0
offset_bottom = 985.0
[node name="VBoxContainer" type="VBoxContainer" parent="Icons"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="ccVanIcon" type="Sprite2D" parent="Icons/VBoxContainer"]
position = Vector2(11, 0)
scale = Vector2(0.874, 0.874)
texture = ExtResource("1_vkoxt")
centered = false
[connection signal="pressed" from="Main/HBoxContainer/Van" to="." method="_on_van_pressed"]
[connection signal="pressed" from="Main/HBoxContainer/Choc" to="." method="_on_choc_pressed"]

@ -1,6 +1,10 @@
[gd_scene format=3 uid="uid://cpv7y67qtmino"] [gd_scene load_steps=3 format=3 uid="uid://cpv7y67qtmino"]
[ext_resource type="Script" path="res://Scripts/upgrades.gd" id="1_ofi8s"]
[ext_resource type="Texture2D" uid="uid://7fqro4fugv8k" path="res://Art/Cupcakes/Cupcake.png" id="2_c66ch"]
[node name="Upgrades" type="CanvasLayer"] [node name="Upgrades" type="CanvasLayer"]
script = ExtResource("1_ofi8s")
[node name="Anim" type="AnimationPlayer" parent="."] [node name="Anim" type="AnimationPlayer" parent="."]
@ -49,6 +53,94 @@ anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
vertical_scroll_mode = 2
[node name="VanGrid" type="GridContainer" parent="Control/ScrollContainer"]
custom_minimum_size = Vector2(64, 64)
layout_mode = 2
size_flags_horizontal = 3
[node name="VanUp1" type="HBoxContainer" parent="Control/ScrollContainer/VanGrid"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="Control/ScrollContainer/VanGrid/VanUp1"]
layout_mode = 2
texture = ExtResource("2_c66ch")
[node name="Name" type="Label" parent="Control/ScrollContainer/VanGrid/VanUp1"]
layout_mode = 2
text = "More Cupcakes"
[node name="Desc" type="Label" parent="Control/ScrollContainer/VanGrid/VanUp1"]
layout_mode = 2
text = "+1 cupcake per drop"
[node name="Price" type="Label" parent="Control/ScrollContainer/VanGrid/VanUp1"]
layout_mode = 2
text = "10"
[node name="Buy" type="Button" parent="Control/ScrollContainer/VanGrid/VanUp1"]
layout_mode = 2
text = "Buy"
[node name="VanUp2" type="HBoxContainer" parent="Control/ScrollContainer/VanGrid"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="Control/ScrollContainer/VanGrid/VanUp2"]
layout_mode = 2
texture = ExtResource("2_c66ch")
[node name="Name" type="Label" parent="Control/ScrollContainer/VanGrid/VanUp2"]
layout_mode = 2
text = "Faster Cupcakes"
[node name="Desc" type="Label" parent="Control/ScrollContainer/VanGrid/VanUp2"]
layout_mode = 2
text = "+1% faster cupcake droprate"
[node name="Price" type="Label" parent="Control/ScrollContainer/VanGrid/VanUp2"]
layout_mode = 2
text = "15"
[node name="Buy" type="Button" parent="Control/ScrollContainer/VanGrid/VanUp2"]
layout_mode = 2
text = "Buy"
[node name="VanUp3" type="HBoxContainer" parent="Control/ScrollContainer/VanGrid"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="Control/ScrollContainer/VanGrid/VanUp3"]
layout_mode = 2
texture = ExtResource("2_c66ch")
[node name="Name" type="Label" parent="Control/ScrollContainer/VanGrid/VanUp3"]
layout_mode = 2
text = "Condensed Cupcakes"
[node name="Desc" type="Label" parent="Control/ScrollContainer/VanGrid/VanUp3"]
layout_mode = 2
text = "+1 cupcake for every cupcake collected"
[node name="VBoxContainer" type="VBoxContainer" parent="Control/ScrollContainer"] [node name="Price" type="Label" parent="Control/ScrollContainer/VanGrid/VanUp3"]
layout_mode = 2 layout_mode = 2
text = "15"
[node name="Buy" type="Button" parent="Control/ScrollContainer/VanGrid/VanUp3"]
layout_mode = 2
text = "Buy"
[node name="VScrollBar" type="VScrollBar" parent="Control"]
layout_mode = 2
anchor_left = 1.0
anchor_top = 0.033
anchor_right = 1.021
anchor_bottom = 0.989
offset_left = 8.0
offset_top = -0.046999
offset_right = -0.20105
offset_bottom = 0.348999
[connection signal="pressed" from="Close" to="." method="_on_close_pressed"]
[connection signal="pressed" from="Control/ScrollContainer/VanGrid/VanUp1/Buy" to="." method="_on_buy_pressed"]
[connection signal="pressed" from="Control/ScrollContainer/VanGrid/VanUp2/Buy" to="." method="_on_buy_van2_pressed"]
[connection signal="pressed" from="Control/ScrollContainer/VanGrid/VanUp3/Buy" to="." method="_on_buy_van3_pressed"]

@ -1,35 +1,51 @@
[gd_scene load_steps=6 format=3 uid="uid://dlypem0porccr"] [gd_scene load_steps=8 format=3 uid="uid://dlypem0porccr"]
[ext_resource type="Script" path="res://Scripts/game_world.gd" id="1_c2sx0"] [ext_resource type="Script" path="res://Scripts/game_world.gd" id="1_c2sx0"]
[ext_resource type="Script" path="res://Scripts/Cupcake Spawn Timer.gd" id="2_bjylp"] [ext_resource type="Script" path="res://Scripts/Cupcake Spawn Timer.gd" id="2_bjylp"]
[ext_resource type="PackedScene" uid="uid://dswkgkor3yejo" path="res://Scenes/Cupcakes/cupcake.tscn" id="2_fi3r2"] [ext_resource type="PackedScene" uid="uid://dswkgkor3yejo" path="res://Scenes/Cupcakes/cupcake.tscn" id="2_fi3r2"]
[ext_resource type="PackedScene" uid="uid://cpv7y67qtmino" path="res://Scenes/UI/upgrades.tscn" id="2_vdy4r"]
[ext_resource type="Script" path="res://Scripts/PlayArea.gd" id="3_3x1i6"] [ext_resource type="Script" path="res://Scripts/PlayArea.gd" id="3_3x1i6"]
[ext_resource type="PackedScene" uid="uid://c4dtrk2kooa6q" path="res://Scenes/UI/ingame_ui.tscn" id="3_wm6l6"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_sh03e"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_g5fj2"]
size = Vector2(1943, 1102) size = Vector2(1841, 1003)
[node name="GameWorld" type="Node2D"] [node name="GameWorld" type="Node2D"]
script = ExtResource("1_c2sx0") script = ExtResource("1_c2sx0")
[node name="Location" type="Node2D" parent="."] [node name="Location" type="Node2D" parent="."]
[node name="Upgrades" parent="." instance=ExtResource("2_vdy4r")]
visible = false
[node name="InGameUI" parent="." instance=ExtResource("3_wm6l6")]
[node name="Cupcake Spawn Timer" type="Timer" parent="."] [node name="Cupcake Spawn Timer" type="Timer" parent="."]
wait_time = 2.0 wait_time = 5.0
autostart = true autostart = true
script = ExtResource("2_bjylp") script = ExtResource("2_bjylp")
[node name="Cupcakes" type="Node2D" parent="."]
[node name="Cupcake" parent="Cupcakes" instance=ExtResource("2_fi3r2")]
position = Vector2(283, -176)
[node name="PlayArea" type="Area2D" parent="."] [node name="PlayArea" type="Area2D" parent="."]
light_mask = 3
visibility_layer = 3
collision_layer = 3
collision_mask = 3
script = ExtResource("3_3x1i6") script = ExtResource("3_3x1i6")
[node name="Cupcake" parent="PlayArea" instance=ExtResource("2_fi3r2")]
position = Vector2(83, -168)
collision_layer = 1
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayArea"] [node name="CollisionShape2D" type="CollisionShape2D" parent="PlayArea"]
position = Vector2(961.5, 541) position = Vector2(961.5, 533.5)
shape = SubResource("RectangleShape2D_sh03e") shape = SubResource("RectangleShape2D_g5fj2")
[connection signal="condensedCupcake1" from="." to="Cupcakes/Cupcake" method="_on_game_world_condensed_cupcake_1"]
[connection signal="condensedCupcake1" from="Upgrades" to="." method="_on_upgrades_condensed_cupcake_1"]
[connection signal="fasterCupcake" from="Upgrades" to="." method="_on_upgrades_faster_cupcake"]
[connection signal="oneMoreCupcake" from="Upgrades" to="." method="_on_upgrades_one_more_cupcake"]
[connection signal="timeout" from="Cupcake Spawn Timer" to="." method="_on_timeout"] [connection signal="timeout" from="Cupcake Spawn Timer" to="." method="_on_timeout"]
[connection signal="area_exited" from="PlayArea" to="." method="_on_play_area_area_exited"] [connection signal="ccVanCollected" from="Cupcakes/Cupcake" to="." method="_on_cupcake_cc_van_collected"]
[connection signal="area_exited" from="PlayArea" to="PlayArea" method="_on_area_exited"]
[connection signal="body_exited" from="PlayArea" to="." method="_on_play_area_body_exited"] [connection signal="body_exited" from="PlayArea" to="." method="_on_play_area_body_exited"]
[connection signal="body_exited" from="PlayArea" to="Cupcakes/Cupcake" method="_on_play_area_body_exited"]

@ -2,6 +2,11 @@ extends RigidBody2D
var speed = Vector2.ZERO var speed = Vector2.ZERO
var horse = preload("res://Scripts/horse.gd") var horse = preload("res://Scripts/horse.gd")
@onready var playArea = $"../../PlayArea"
@onready var ccCol
var scorecard = preload("res://Scripts/varVar.gd")
var ccValue = 1
signal ccVanCollected()
func _ready(): func _ready():
pass # Replace with function body. pass # Replace with function body.
@ -12,3 +17,13 @@ func _process(delta):
pass pass
func _on_play_area_body_exited(body):
if body.get_parent() == $"../../Cupcakes":
emit_signal("ccVanCollected")
body.queue_free()
func _on_game_world_condensed_cupcake_1():
ccValue += 1

@ -11,8 +11,3 @@ func _process(delta):
pass pass
func _on_area_exited(body):
if body.is_in_group("Cupcake"):
horse.ccVanNum += 1
print(horse.ccVanNum)
body.queue_free()

@ -1,18 +1,32 @@
extends Node2D extends Node2D
var inGameUI = preload("res://Scenes/UI/ingame_ui.tscn") signal condensedCupcake1()
#Cupcake Values
var ccVanNum: int = 0
var ccChocNum: int = 0
#Cupcake Prices
var ccVanPrice: int = 10
var ccVanPrice2: int = 15
var ccVanPrice3: int = 15
var ccChocPrice: int = 10
#Preloaded scenes and scripts
var upgradeUI = preload("res://Scenes/UI/upgrades.tscn") var upgradeUI = preload("res://Scenes/UI/upgrades.tscn")
var location = preload("res://Scenes/Locations/yard.tscn") var location = preload("res://Scenes/Locations/yard.tscn")
var horse_scene = preload("res://Scenes/horse.tscn") var horse_scene = preload("res://Scenes/horse.tscn")
var horse = preload("res://Scripts/horse.gd") 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 ccVanilla = preload("res://Scenes/Cupcakes/cupcake.tscn")
var ccvan = ccVanilla.instantiate()
var ccChocolate var ccChocolate
var ccchoc var ccchoc
var ccSpawnRate = 25
#Other
var horseAttached = true
var horse_instance
var mouse_position = Vector2.ZERO
var ccvan = ccVanilla.instantiate()
var ccSpawnRate = 3
var ccCount = 0 var ccCount = 0
var ccMaxOnScreen = 2000 var ccMaxOnScreen = 2000
@ -20,15 +34,23 @@ func _ready():
var spawn var spawn
horse_instance = horse_scene.instantiate() horse_instance = horse_scene.instantiate()
spawn = location.instantiate() spawn = location.instantiate()
IGUI = inGameUI.instantiate()
$Location.add_child(spawn) $Location.add_child(spawn)
add_child(horse_instance) add_child(horse_instance)
add_child(IGUI)
func _process(delta): func _process(delta):
if horseAttached == true:
mouse_position = get_global_mouse_position() mouse_position = get_global_mouse_position()
horse_instance.position = mouse_position horse_instance.position = mouse_position
handleInput()
func handleInput():
if Input.is_action_pressed("horseAttach"):
if horseAttached == true:
horseAttached = false
else:
horseAttached = true
func spawnCupcakes(): func spawnCupcakes():
var randX var randX
@ -39,19 +61,50 @@ func spawnCupcakes():
randX = randi_range(10, 1910) randX = randi_range(10, 1910)
randY = randi_range(10, 1070) randY = randi_range(10, 1070)
ccvan.position = Vector2(randX, randY) ccvan.position = Vector2(randX, randY)
$PlayArea.add_child(ccvan.duplicate()) $Cupcakes.add_child(ccvan.duplicate())
ccCount = ccCount + 25 ccCount = ccCount + ccSpawnRate
func collectCupcakes(): func collectCupcakes():
pass $InGameUI/Num/VBoxContainer/ccVanNum.text = str(ccVanNum)
func _on_timeout(): func _on_timeout():
var timer = get_node("Cupcake Spawn Timer") var timer = get_node("Cupcake Spawn Timer")
spawnCupcakes() spawnCupcakes()
collectCupcakes()
timer.start timer.start
func _on_play_area_body_exited(body): func _on_play_area_body_exited(body):
pass pass
func _on_cupcake_cc_van_collected():
ccVanNum += 1
ccCount -= 1
collectCupcakes()
func _on_upgrades_one_more_cupcake():
if ccVanNum >= ccVanPrice:
ccSpawnRate += 1
ccVanNum -= ccVanPrice
ccVanPrice = ccVanPrice * 2
$Upgrades/Control/ScrollContainer/VanGrid/VanUp1/Price.text = str(ccVanPrice)
collectCupcakes()
func _on_upgrades_faster_cupcake():
pass # Replace with function body.
func _on_upgrades_condensed_cupcake():
pass
func _on_upgrades_condensed_cupcake_1():
if ccVanNum >= ccVanPrice3:
ccVanNum -= ccVanPrice3
ccVanPrice2 = ccVanPrice3 * 2
emit_signal("condensedCupcakes1")
$Upgrades/Control/ScrollContainer/VanGrid/VanUp3/Price.text = str(ccVanPrice3)

@ -0,0 +1,25 @@
extends CanvasLayer
@onready var upgrades = $"../Upgrades"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_van_pressed():
if upgrades.visible == false:
upgrades.visible = true
else:
upgrades.visible = false
func _on_choc_pressed():
if upgrades.visible == false:
upgrades.visible = true
else:
upgrades.visible = false

@ -0,0 +1,28 @@
extends CanvasLayer
signal oneMoreCupcake()
signal fasterCupcake()
signal condensedCupcake1()
func _ready():
pass # Replace with function body.
func _on_close_pressed():
self.visible = false
func _on_buy_pressed():
emit_signal("oneMoreCupcake")
func _on_buy_van2_pressed():
emit_signal("fasterCupcake")
func _on_buy_van3_pressed():
emit_signal("condensedCupcake1")

@ -1,11 +1,6 @@
extends Node extends Node
var location
# Called when the node enters the scene tree for the first time. var ccVanNum = 0
func _ready(): var ccChocNum = 0
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass

@ -0,0 +1,41 @@
[preset.0]
name="Linux/X11"
platform="Linux/X11"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_encryption_key=""
[preset.0.options]
custom_template/debug=""
custom_template/release=""
debug/export_console_script=1
binary_format/embed_pck=false
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
binary_format/architecture="x86_64"
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="#!/usr/bin/env bash
export DISPLAY=:0
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
\"{temp_dir}/{exe_name}\" {cmd_args}"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""

@ -24,3 +24,11 @@ window/stretch/mode="viewport"
version_control/plugin_name="GitPlugin" version_control/plugin_name="GitPlugin"
version_control/autoload_on_startup=true version_control/autoload_on_startup=true
[input]
horseAttach={
"deadzone": 0.5,
"events": [Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"button_mask":0,"position":Vector2(0, 0),"global_position":Vector2(0, 0),"factor":1.0,"button_index":2,"pressed":false,"double_click":false,"script":null)
]
}

Loading…
Cancel
Save