From 21609e84f29ca7461d548915dc5b0acef0b82bf1 Mon Sep 17 00:00:00 2001 From: Zoey Kitt Date: Sat, 16 Nov 2024 17:46:13 -0600 Subject: Finish migration I think? I got distracted --- scenes/score_window/score_window.gd | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 scenes/score_window/score_window.gd (limited to 'scenes/score_window') 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) -- cgit v1.2.3