Compare commits

..

No commits in common. "0f09ea31651be4d6270ad0669c29ecc88c01af20" and "e86327a32036ea96912413ab621e555e730e53de" have entirely different histories.

5 changed files with 36 additions and 113 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=62 format=3 uid="uid://bohp0o2smdkwe"] [gd_scene load_steps=60 format=3 uid="uid://bohp0o2smdkwe"]
[ext_resource type="Script" uid="uid://c2mrlu8d75ry4" path="res://gavel.gd" id="1_ep8l3"] [ext_resource type="Script" uid="uid://c2mrlu8d75ry4" path="res://gavel.gd" id="1_ep8l3"]
[ext_resource type="Script" uid="uid://d2ophrxm0wtr6" path="res://desk.gd" id="1_yugeg"] [ext_resource type="Script" uid="uid://d2ophrxm0wtr6" path="res://desk.gd" id="1_yugeg"]
@ -49,7 +49,6 @@
[ext_resource type="Texture2D" uid="uid://b5ijw66s6ibkb" path="res://assets/numpad/backspace-depressed.png" id="26_e06cl"] [ext_resource type="Texture2D" uid="uid://b5ijw66s6ibkb" path="res://assets/numpad/backspace-depressed.png" id="26_e06cl"]
[ext_resource type="Texture2D" uid="uid://cgdy173ukgmo1" path="res://assets/gavel/gavel-hit-frame_22.png" id="26_kpd5h"] [ext_resource type="Texture2D" uid="uid://cgdy173ukgmo1" path="res://assets/gavel/gavel-hit-frame_22.png" id="26_kpd5h"]
[ext_resource type="Texture2D" uid="uid://mm2l5d1s3rah" path="res://assets/gavel/gavel-hit-frame_23.png" id="27_6p2km"] [ext_resource type="Texture2D" uid="uid://mm2l5d1s3rah" path="res://assets/gavel/gavel-hit-frame_23.png" id="27_6p2km"]
[ext_resource type="FontFile" uid="uid://cm28kqtqj3a6n" path="res://assets/amiga4ever pro.ttf" id="27_k4eer"]
[ext_resource type="Texture2D" uid="uid://bwhf5712gd67h" path="res://assets/numpad/ask.png" id="27_unpof"] [ext_resource type="Texture2D" uid="uid://bwhf5712gd67h" path="res://assets/numpad/ask.png" id="27_unpof"]
[ext_resource type="Texture2D" uid="uid://cxwxmqnnbyl3s" path="res://assets/numpad/ask-depressed.png" id="28_4l1rv"] [ext_resource type="Texture2D" uid="uid://cxwxmqnnbyl3s" path="res://assets/numpad/ask-depressed.png" id="28_4l1rv"]
[ext_resource type="AudioStream" uid="uid://bvto7ghmy8j0o" path="res://assets/gavel/audio/invalid-bet.wav" id="31_v5y5a"] [ext_resource type="AudioStream" uid="uid://bvto7ghmy8j0o" path="res://assets/gavel/audio/invalid-bet.wav" id="31_v5y5a"]
@ -147,10 +146,6 @@ animations = [{
"speed": 15.0 "speed": 15.0
}] }]
[sub_resource type="Theme" id="Theme_857t2"]
default_font = ExtResource("27_k4eer")
default_font_size = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8sdgr"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8sdgr"]
bg_color = Color(0.5109665, 0, 0.077832855, 1) bg_color = Color(0.5109665, 0, 0.077832855, 1)
@ -203,16 +198,6 @@ timer_reduction_step = 0.4
texture_filter = 1 texture_filter = 1
texture = ExtResource("5_r8wvv") texture = ExtResource("5_r8wvv")
[node name="NumpadDisplay" type="RichTextLabel" parent="Numpad"]
unique_name_in_owner = true
offset_left = -160.0
offset_top = -136.0
offset_right = 156.0
offset_bottom = -113.0
theme = SubResource("Theme_857t2")
horizontal_alignment = 1
vertical_alignment = 1
[node name="0" parent="Numpad" instance=ExtResource("3_se7ci")] [node name="0" parent="Numpad" instance=ExtResource("3_se7ci")]
offset_left = -53.0 offset_left = -53.0
offset_top = 60.0 offset_top = 60.0

View file

@ -16,31 +16,12 @@ var paintings: Array[PaintingInfo] = []
var current_painting_idx := 0 var current_painting_idx := 0
# tracker variables for bid markers, proposing bids happens between numpad and audience # tracker variables for bid markers, proposing bids happens between numpad and audience
var current_bid := 0: var current_bid := 0
set(value): var starting_price := 0
if is_instance_valid(going_price_label): var final_bid := 0
going_price_label.text = "Bid: $%sk" % [int(floor(value / 1000.0))] @export var current_bid_display: RichTextLabel
current_bid = value
var starting_price := 0:
set(value):
if is_instance_valid(starting_price_label):
if value == 0 or state == bidding_state.CLOSED:
starting_price_label.text = "Starting Price: Pending"
else:
starting_price_label.text = "Starting Price: $%sk" % [int(floor(value / 1000.0))]
starting_price = value
var final_bid := 0:
set(value):
if is_instance_valid(going_price_label):
going_price_label.text = "Sold for $%sk!" % [int(floor(value / 1000.0))]
final_bid = value
var target_sales := 0:
set(value):
if is_instance_valid(quota_label):
quota_label.text = "Quota: $%sk Progress: 0%%" % [int(floor(value / 1000.0))]
target_sales = value
var target_sales := 0
#var total_sales: int = 0 #var total_sales: int = 0
@export var sales_magnitude := 100000 @export var sales_magnitude := 100000
@export var single_painting_magnitude := 1000 @export var single_painting_magnitude := 1000
@ -50,10 +31,6 @@ var target_sales := 0:
var bidding_open := false var bidding_open := false
var state := bidding_state.CLOSED var state := bidding_state.CLOSED
@export var quota_label: Label
@export var starting_price_label: Label
@export var going_price_label: Label
func _ready() -> void: func _ready() -> void:
audience_manager.ask_accepted.connect(_handle_ask_accepted) audience_manager.ask_accepted.connect(_handle_ask_accepted)
desk.gavel.gavel_hit.connect(_handle_gavel_hit) desk.gavel.gavel_hit.connect(_handle_gavel_hit)
@ -87,7 +64,7 @@ func _handle_gavel_hit():
match state: match state:
bidding_state.CLOSED: bidding_state.CLOSED:
state = bidding_state.READY state = bidding_state.READY
starting_price = starting_price current_bid_display.set_text("Starting price: $%s" % [starting_price])
bidding_state.ASKING: bidding_state.ASKING:
if current_bid != 0: if current_bid != 0:
sell_painting() sell_painting()
@ -113,8 +90,8 @@ func sell_painting():
cancel_bidding() cancel_bidding()
move_painting_to_bidders_pile() move_painting_to_bidders_pile()
paintings[current_painting_idx].sold_for = current_bid paintings[current_painting_idx].sold_for = current_bid
current_bid_display.set_text("Sold for $%s!" % [current_bid])
turn_manager.speak_sentence("Sold for $%s!" % [current_bid]) turn_manager.speak_sentence("Sold for $%s!" % [current_bid])
quota_label.text = "Quota: $%sk Progress: %s%%" % [floor(target_sales / 1000.0), floor((float(get_total_sales()) / float(target_sales) * 100.0))]
print("Congrats on selling your painting for $%s! You have made $%s so far." % [current_bid, get_total_sales()]) print("Congrats on selling your painting for $%s! You have made $%s so far." % [current_bid, get_total_sales()])
@ -138,7 +115,7 @@ func next_painting() -> bool:
func _handle_ask_accepted(): func _handle_ask_accepted():
pass current_bid_display.set_text("Current bid: $" + str(current_bid))
func end_auction(): func end_auction():

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=17 format=3 uid="uid://dt4nq0nkmjiit"] [gd_scene load_steps=18 format=3 uid="uid://dt4nq0nkmjiit"]
[ext_resource type="Script" uid="uid://b5tcsve1oo5ht" path="res://game_manager.gd" id="1_ig7tw"] [ext_resource type="Script" uid="uid://b5tcsve1oo5ht" path="res://game_manager.gd" id="1_ig7tw"]
[ext_resource type="Texture2D" uid="uid://cvqsf1nlfqwpr" path="res://assets/background/background.png" id="1_lquwl"] [ext_resource type="Texture2D" uid="uid://cvqsf1nlfqwpr" path="res://assets/background/background.png" id="1_lquwl"]
@ -13,6 +13,7 @@
[ext_resource type="PackedScene" uid="uid://c1acpop6amvcl" path="res://audience_manager.tscn" id="6_272bh"] [ext_resource type="PackedScene" uid="uid://c1acpop6amvcl" path="res://audience_manager.tscn" id="6_272bh"]
[ext_resource type="PackedScene" uid="uid://b8key4hjaldui" path="res://turn_manager.tscn" id="7_272bh"] [ext_resource type="PackedScene" uid="uid://b8key4hjaldui" path="res://turn_manager.tscn" id="7_272bh"]
[ext_resource type="Script" path="res://captions.gd" id="10_ryguw"] [ext_resource type="Script" path="res://captions.gd" id="10_ryguw"]
[ext_resource type="PackedScene" uid="uid://6a4hl2twv0lj" path="res://cursor_manager.tscn" id="20_82xsv"]
[ext_resource type="AudioStream" uid="uid://b6u25i4ivxist" path="res://theme.ogg" id="22_ryguw"] [ext_resource type="AudioStream" uid="uid://b6u25i4ivxist" path="res://theme.ogg" id="22_ryguw"]
[sub_resource type="Theme" id="Theme_272bh"] [sub_resource type="Theme" id="Theme_272bh"]
@ -45,36 +46,34 @@ texture = ExtResource("3_272bh")
unique_name_in_owner = true unique_name_in_owner = true
[node name="PaintingDisplay7" parent="Paintings" instance=ExtResource("4_d13ii")] [node name="PaintingDisplay7" parent="Paintings" instance=ExtResource("4_d13ii")]
position = Vector2(1074, 162) position = Vector2(1074, 136)
[node name="PaintingDisplay6" parent="Paintings" instance=ExtResource("4_d13ii")] [node name="PaintingDisplay6" parent="Paintings" instance=ExtResource("4_d13ii")]
position = Vector2(1074, 162) position = Vector2(1074, 136)
[node name="PaintingDisplay5" parent="Paintings" instance=ExtResource("4_d13ii")] [node name="PaintingDisplay5" parent="Paintings" instance=ExtResource("4_d13ii")]
position = Vector2(1074, 162) position = Vector2(1074, 136)
[node name="PaintingDisplay4" parent="Paintings" instance=ExtResource("4_d13ii")] [node name="PaintingDisplay4" parent="Paintings" instance=ExtResource("4_d13ii")]
position = Vector2(1074, 162) position = Vector2(1074, 136)
[node name="PaintingDisplay3" parent="Paintings" instance=ExtResource("4_d13ii")] [node name="PaintingDisplay3" parent="Paintings" instance=ExtResource("4_d13ii")]
position = Vector2(1074, 162) position = Vector2(1074, 136)
[node name="PaintingDisplay2" parent="Paintings" instance=ExtResource("4_d13ii")] [node name="PaintingDisplay2" parent="Paintings" instance=ExtResource("4_d13ii")]
position = Vector2(1074, 162) position = Vector2(1074, 136)
[node name="PaintingDisplay1" parent="Paintings" instance=ExtResource("4_d13ii")] [node name="PaintingDisplay1" parent="Paintings" instance=ExtResource("4_d13ii")]
unique_name_in_owner = true unique_name_in_owner = true
position = Vector2(1075, 162) position = Vector2(1074, 136)
[node name="GameManager" type="Node2D" parent="." node_paths=PackedStringArray("audience_manager", "desk", "turn_manager", "quota_label", "starting_price_label", "going_price_label")] [node name="GameManager" type="Node2D" parent="." node_paths=PackedStringArray("audience_manager", "desk", "turn_manager", "current_bid_display")]
unique_name_in_owner = true unique_name_in_owner = true
script = ExtResource("1_ig7tw") script = ExtResource("1_ig7tw")
audience_manager = NodePath("../AudienceManager") audience_manager = NodePath("../AudienceManager")
desk = NodePath("../Desk") desk = NodePath("../Desk")
turn_manager = NodePath("../TurnManager") turn_manager = NodePath("../TurnManager")
quota_label = NodePath("../UI/Quota") current_bid_display = NodePath("../UI/RichTextLabel")
starting_price_label = NodePath("../UI/StartingPrice")
going_price_label = NodePath("../UI/GoingPrice")
[node name="Timer" type="Timer" parent="GameManager"] [node name="Timer" type="Timer" parent="GameManager"]
wait_time = 300.0 wait_time = 300.0
@ -97,7 +96,6 @@ layout_mode = 3
anchors_preset = 0 anchors_preset = 0
[node name="RichTextLabel" type="RichTextLabel" parent="UI"] [node name="RichTextLabel" type="RichTextLabel" parent="UI"]
visible = false
layout_mode = 0 layout_mode = 0
offset_left = 480.0 offset_left = 480.0
offset_top = 434.0 offset_top = 434.0
@ -119,39 +117,6 @@ horizontal_alignment = 1
vertical_alignment = 1 vertical_alignment = 1
script = ExtResource("10_ryguw") script = ExtResource("10_ryguw")
[node name="Quota" type="Label" parent="UI"]
layout_mode = 0
offset_left = 756.0
offset_top = 13.0
offset_right = 1256.0
offset_bottom = 53.0
text = "Quota: 500k Progress: 50%"
label_settings = SubResource("LabelSettings_ryguw")
horizontal_alignment = 1
vertical_alignment = 1
[node name="StartingPrice" type="Label" parent="UI"]
layout_mode = 0
offset_left = 857.0
offset_top = 259.0
offset_right = 1257.0
offset_bottom = 299.0
text = "Starting Price: 25k"
label_settings = SubResource("LabelSettings_ryguw")
horizontal_alignment = 1
vertical_alignment = 1
[node name="GoingPrice" type="Label" parent="UI"]
layout_mode = 0
offset_left = 857.0
offset_top = 296.0
offset_right = 1257.0
offset_bottom = 336.0
text = "Asking: 50k"
label_settings = SubResource("LabelSettings_ryguw")
horizontal_alignment = 1
vertical_alignment = 1
[node name="AudienceManager" parent="." node_paths=PackedStringArray("desk", "game_manager") instance=ExtResource("6_272bh")] [node name="AudienceManager" parent="." node_paths=PackedStringArray("desk", "game_manager") instance=ExtResource("6_272bh")]
desk = NodePath("../Desk") desk = NodePath("../Desk")
game_manager = NodePath("../GameManager") game_manager = NodePath("../GameManager")
@ -161,6 +126,8 @@ desk = NodePath("../Desk")
captions = NodePath("../UI/Captions") captions = NodePath("../UI/Captions")
audience_manager = NodePath("../AudienceManager") audience_manager = NodePath("../AudienceManager")
[node name="CursorManager" parent="." instance=ExtResource("20_82xsv")]
[node name="BackgroundMusic" type="AudioStreamPlayer" parent="."] [node name="BackgroundMusic" type="AudioStreamPlayer" parent="."]
unique_name_in_owner = true unique_name_in_owner = true
stream = ExtResource("22_ryguw") stream = ExtResource("22_ryguw")

View file

@ -1,12 +1,6 @@
class_name Numpad extends Node2D class_name Numpad extends Node2D
var numpad_buffer: String = "": var numpad_buffer = Array()
set(value):
if value.is_empty():
%NumpadDisplay.text = "Enter a value"
else:
%NumpadDisplay.text = "%sk" % [value]
numpad_buffer = value
var proposed_ask: int var proposed_ask: int
signal ask_proposed(amount) signal ask_proposed(amount)
@ -33,14 +27,14 @@ func _process(_delta: float) -> void:
# number entry function called by numbered button children # number entry function called by numbered button children
func keypad_entry(entry: int): func keypad_entry(entry: int):
numpad_buffer += str(entry) numpad_buffer.append(str(entry))
func keypad_backspace(): func keypad_backspace():
if not numpad_buffer.is_empty(): if numpad_buffer.size() > 0:
numpad_buffer = numpad_buffer.erase(numpad_buffer.length() - 1) numpad_buffer.remove_at(-1)
func keypad_submit(): func keypad_submit():
var keypad_output: String = numpad_buffer var keypad_output: String = "".join(numpad_buffer)
proposed_ask = int(keypad_output) * 1000 proposed_ask = int(keypad_output) * 1000
if proposed_ask == 0: return if proposed_ask == 0: return
@ -81,7 +75,7 @@ func keypad_submit():
# need to avoid starting the reminder timer before # need to avoid starting the reminder timer before
# the auction starts # the auction starts
numpad_buffer = "" numpad_buffer.clear()
func reset_timer(): func reset_timer():
timer_duration = base_timer_duration timer_duration = base_timer_duration