summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoey Kitt <zoey.kitt@outlook.com>2024-11-16 17:46:13 -0600
committerZoey Kitt <zoey.kitt@outlook.com>2024-11-16 17:46:13 -0600
commit21609e84f29ca7461d548915dc5b0acef0b82bf1 (patch)
treeda3bc6bcf608362bc08c6ade122b5c822c8220d4
parent7546c31057cbdec92c08e5d2ed3b59b5910a0956 (diff)
Finish migration I think? I got distracted
-rw-r--r--scenes/main.gd17
-rw-r--r--scenes/main.tscn8
-rw-r--r--scenes/score_window/score_window.gd24
3 files changed, 29 insertions, 20 deletions
diff --git a/scenes/main.gd b/scenes/main.gd
index 7025386..dbfcd65 100644
--- a/scenes/main.gd
+++ b/scenes/main.gd
@@ -1,23 +1,14 @@
extends Node2D
-var net_worth: Big
-
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
_on_microgame_spawn_timer_timeout()
- net_worth = Big.new(1000)
-
- var window = get_window()
- window.position = Vector2(450, 360)
- window.size = Vector2(1319, 300)
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
# The most important functionality
if Input.is_action_just_pressed("G"):
$Meow.play()
-
- #$Score.text = "Net worth: \n$%s" % net_worth.toString()
func _on_microgame_spawn_timer_timeout() -> void:
@@ -40,11 +31,3 @@ func _on_microgame_spawn_timer_timeout() -> void:
func _on_microgame_win(window: MicrogameWindow):
print("yay")
-
-
-func _on_stock_ticker_buy(amount: Variant) -> void:
- net_worth = net_worth.minus(amount)
-
-
-func _on_stock_ticker_sell(amount: Variant) -> void:
- net_worth = net_worth.plus(amount)
diff --git a/scenes/main.tscn b/scenes/main.tscn
index 98fd364..c8332e0 100644
--- a/scenes/main.tscn
+++ b/scenes/main.tscn
@@ -1,4 +1,4 @@
-[gd_scene load_steps=48 format=3 uid="uid://d06d1vihf2oqp"]
+[gd_scene load_steps=49 format=3 uid="uid://d06d1vihf2oqp"]
[ext_resource type="Texture2D" uid="uid://b03ygtrwha22g" path="res://taytay/IMG_5199.jpeg" id="1_o2s48"]
[ext_resource type="Script" path="res://scenes/main.gd" id="1_y7a0r"]
@@ -7,6 +7,7 @@
[ext_resource type="AudioStream" uid="uid://wtoxhk0tf8ev" path="res://funny_sounds/Cat Meow - Minecraft Sound Effect (HD).mp3" id="3_gatxj"]
[ext_resource type="PackedScene" uid="uid://g2veoq55y14i" path="res://scenes/stockticker/Stock Ticker.tscn" id="4_0ankd"]
[ext_resource type="PackedScene" uid="uid://bbg7lnak6kup7" path="res://scenes/LegallyDistinctPaperclipAssistant/window.tscn" id="5_6agvn"]
+[ext_resource type="Script" path="res://scenes/score_window/score_window.gd" id="6_gvoxs"]
[ext_resource type="Texture2D" uid="uid://dohsqvvi8y64h" path="res://UI/fish-spinning-ezgif.com-gif-to-sprite-converter.png" id="8_oj2tc"]
[sub_resource type="AtlasTexture" id="AtlasTexture_uyge7"]
@@ -308,6 +309,7 @@ size = Vector2i(1280, 720)
[node name="Clippette" parent="." instance=ExtResource("5_6agvn")]
[node name="Score window" type="Node2D" parent="."]
+script = ExtResource("6_gvoxs")
[node name="Background" type="Sprite2D" parent="Score window"]
modulate = Color(0.796078, 0.796078, 0.796078, 1)
@@ -334,5 +336,5 @@ text = "Net worth:
$00000000000000000000"
[connection signal="timeout" from="Microgame spawn timer" to="." method="_on_microgame_spawn_timer_timeout"]
-[connection signal="buy" from="Stock ticker window/Stock ticker" to="." method="_on_stock_ticker_buy"]
-[connection signal="sell" from="Stock ticker window/Stock ticker" to="." method="_on_stock_ticker_sell"]
+[connection signal="buy" from="Stock ticker window/Stock ticker" to="Score window" method="_on_stock_ticker_buy"]
+[connection signal="sell" from="Stock ticker window/Stock ticker" to="Score window" method="_on_stock_ticker_sell"]
diff --git a/scenes/score_window/score_window.gd b/scenes/score_window/score_window.gd
new file mode 100644
index 0000000..f4159af
--- /dev/null
+++ b/scenes/score_window/score_window.gd
@@ -0,0 +1,24 @@
+extends Node2D
+
+var net_worth: Big
+
+# Called when the node enters the scene tree for the first time.
+func _ready() -> void:
+ net_worth = Big.new(1000)
+
+ var window = get_window()
+ window.position = Vector2(450, 360)
+ window.size = Vector2(1319, 300)
+
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(delta: float) -> void:
+ $Score.text = "Net worth: \n$%s" % net_worth.toString()
+
+
+func _on_stock_ticker_buy(amount: Variant) -> void:
+ net_worth = net_worth.minus(amount)
+
+
+func _on_stock_ticker_sell(amount: Variant) -> void:
+ net_worth = net_worth.plus(amount)