ld58-collector/game_manager.gd

56 lines
1.6 KiB
GDScript

class_name GameManager extends Node2D
var paintings_sold = 0
var paintings_total = 0
var paintings: Array = Array()
# tracker variables for bid markers, proposing bids happens between numpad and audience
var current_bid = 0
var final_bid = 0
var target_sales: int = 0
var total_sales: int = 0
# state tracker for a given painting's auction
var bidding_open: bool = false
signal bidding_start
func _ready() -> void:
paintings_total = randi_range(7,10)
target_sales = (paintings_total * 100000)/randf_range(1.25,2) # need to workshop the target sales generation process for more interesting numbers
#var e = 0
#for painting in paintings:
#if e <= paintings_total:
#paintings.append()
#build out the initialization process, which should:
# -- generate paintings and assign values
# -- start the turn timer/auction timer
# ---- also add an auction timer
# -- have tts announcement of starting bid and start of auction
print("You have " + str(paintings_total) + " paintings. Sell them for at least $" + str(target_sales) + " or face the consequences!")
pass
func _on_gavel_gavel_hit():
bidding_open = not bidding_open
if bidding_open == true:
current_bid = target_sales/(paintings_total + 2)
print("The new painting will start selling at $" + str(current_bid))
else:
total_sales = total_sales + current_bid
paintings_sold += 1
print("Congrats on selling your painting for $" + str(current_bid) + "! You have made $" + str(total_sales) + " so far.")
func destroy_painting():
pass
func next_painting():
pass
# OTHER THINGS TO ADD:
# UI elements for score
# Bark manager