summaryrefslogtreecommitdiff
path: root/buy_n_sell.gd
diff options
context:
space:
mode:
authorJacob Janzen <jacob.a.s.janzen@gmail.com>2024-11-15 19:55:15 -0600
committerJacob Janzen <jacob.a.s.janzen@gmail.com>2024-11-15 19:55:15 -0600
commit4f5d964c6890f3281e8673905ab0158dca0ebcf8 (patch)
tree0a998981b599dc198f182bd63b2a80fe0f459390 /buy_n_sell.gd
parent7059818b6fc7a1ce7a305b07ec3e5870ac31ec99 (diff)
complete stock mostly
Diffstat (limited to 'buy_n_sell.gd')
-rw-r--r--buy_n_sell.gd25
1 files changed, 25 insertions, 0 deletions
diff --git a/buy_n_sell.gd b/buy_n_sell.gd
new file mode 100644
index 0000000..be0e777
--- /dev/null
+++ b/buy_n_sell.gd
@@ -0,0 +1,25 @@
+extends Node2D
+
+var stonks = 0
+
+# Called when the node enters the scene tree for the first time.
+func _ready() -> void:
+ var label = $"Shares Held Label"
+ label.text = "Shares\nHeld:%d" % stonks
+
+# Called every frame. 'delta' is the elapsed time since the previous frame.
+func _process(delta: float) -> void:
+ pass
+
+
+func _on_buy_button_button_up() -> void:
+ if stonks < 100:
+ stonks += 1
+ var label = $"Shares Held Label"
+ label.text = "Shares\nHeld:%d" % stonks
+
+func _on_sell_button_button_up() -> void:
+ if stonks > 0:
+ stonks -= 1
+ var label = $"Shares Held Label"
+ label.text = "Shares\nHeld:%d" % stonks