diff options
author | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-11-16 08:23:23 -0600 |
---|---|---|
committer | Jacob Janzen <jacob.a.s.janzen@gmail.com> | 2024-11-16 08:23:23 -0600 |
commit | 4c5307a025ca857ab9fe2b1be6f4d79a0c523008 (patch) | |
tree | 64f3ccd32d685d73b50bbe500d1c7dab55a7c336 /scenes/stockticker/buy_n_sell.gd | |
parent | 524bcdf6570b517d75d4b1617e7c09172fe3cde2 (diff) |
minor refactor
Diffstat (limited to 'scenes/stockticker/buy_n_sell.gd')
-rw-r--r-- | scenes/stockticker/buy_n_sell.gd | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/scenes/stockticker/buy_n_sell.gd b/scenes/stockticker/buy_n_sell.gd new file mode 100644 index 0000000..be0e777 --- /dev/null +++ b/scenes/stockticker/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 |