summaryrefslogtreecommitdiff
path: root/buy_n_sell.gd
blob: be0e7775bf508eb2197be5b9af5b20fe4d6b29eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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