diff options
author | jacob janzen <53062115+JacobJanzen@users.noreply.github.com> | 2024-11-15 19:55:44 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-15 19:55:44 -0600 |
commit | 33a6215be1c05efe3628509a1e0bb53f40b2a3ca (patch) | |
tree | 8c29790ef9c808b2e3b825d3c9a56125b0b10cda /buy_n_sell.gd | |
parent | 7a468e63650bd5f10e8402f416ea988883844f89 (diff) | |
parent | 4f5d964c6890f3281e8673905ab0158dca0ebcf8 (diff) |
Merge pull request #1 from cssa-game-jam-2024/stock-ticker-mvp
Stock ticker mvp
Diffstat (limited to 'buy_n_sell.gd')
-rw-r--r-- | buy_n_sell.gd | 25 |
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 |