diff --git a/assets/background/background.png b/assets/background/background.png new file mode 100644 index 0000000..fce7e5b Binary files /dev/null and b/assets/background/background.png differ diff --git a/assets/background/background.png.import b/assets/background/background.png.import new file mode 100644 index 0000000..db35a48 --- /dev/null +++ b/assets/background/background.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cvqsf1nlfqwpr" +path="res://.godot/imported/background.png-af8116bd94e27df8cdb7b0ec54dd4e56.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/background/background.png" +dest_files=["res://.godot/imported/background.png-af8116bd94e27df8cdb7b0ec54dd4e56.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/chairs/chairs_back.png b/assets/chairs/chairs_back.png new file mode 100644 index 0000000..4785523 Binary files /dev/null and b/assets/chairs/chairs_back.png differ diff --git a/assets/chairs/chairs_back.png.import b/assets/chairs/chairs_back.png.import new file mode 100644 index 0000000..9061963 --- /dev/null +++ b/assets/chairs/chairs_back.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cpj3xw8js3h3" +path="res://.godot/imported/chairs_back.png-1ab8bca6426e19a281aa164a5aa32fd1.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/chairs/chairs_back.png" +dest_files=["res://.godot/imported/chairs_back.png-1ab8bca6426e19a281aa164a5aa32fd1.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/assets/chairs/chairs_front.png b/assets/chairs/chairs_front.png new file mode 100644 index 0000000..8ef816f Binary files /dev/null and b/assets/chairs/chairs_front.png differ diff --git a/assets/chairs/chairs_front.png.import b/assets/chairs/chairs_front.png.import new file mode 100644 index 0000000..0382c4f --- /dev/null +++ b/assets/chairs/chairs_front.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d03ot1f34pyhu" +path="res://.godot/imported/chairs_front.png-51ecaf1695dca8433faf352140433a34.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/chairs/chairs_front.png" +dest_files=["res://.godot/imported/chairs_front.png-51ecaf1695dca8433faf352140433a34.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/audience_manager.gd b/audience_manager.gd new file mode 100644 index 0000000..2b53244 --- /dev/null +++ b/audience_manager.gd @@ -0,0 +1,42 @@ +extends Node2D + +@export var desk: Desk +@export var timer: Timer +@export var game_manager: GameManager + +signal ask_accepted + +#ideally variable for influencing how much the audience responds to barks +@export var audience_susceptibility := 0.4: + set(value): + audience_susceptibility = clamp(value, 0, 1) + +#meant to make the audience more inclined to bid as day progresses +@export var audience_time_pressure := 1.4 + +@export var bid_threshold := 3.0 +@export var think_chance := 0.5 +@export var think_min_time := 1.0 +@export var think_max_time := 5.0 + +func _ready() -> void: + desk.numpad.ask_proposed.connect(_handle_ask_proposed) + timer.timeout.connect(_handle_bid_delay_timeout) + +func raise_paddle(): + #need to add in logic to animate paddle being raised + pass + +func _handle_bid_delay_timeout(): + if randf_range(1.2, 5.3) >= bid_threshold: + raise_paddle() + game_manager.current_bid = desk.numpad.proposed_ask + ask_accepted.emit() + timer.stop() + +func _handle_ask_proposed(): + if randf() <= think_chance: + timer.stop() + var ask_duration: float = randf_range(1.0, 5.0) + timer.wait_time = ask_duration + timer.start() diff --git a/audience_manager.gd.uid b/audience_manager.gd.uid new file mode 100644 index 0000000..56a9b86 --- /dev/null +++ b/audience_manager.gd.uid @@ -0,0 +1 @@ +uid://b1p0muntqup8a diff --git a/desk.gd b/desk.gd new file mode 100644 index 0000000..b7ed7c6 --- /dev/null +++ b/desk.gd @@ -0,0 +1,3 @@ +class_name Desk extends Control + +@export var numpad: Numpad diff --git a/desk.gd.uid b/desk.gd.uid new file mode 100644 index 0000000..0c13664 --- /dev/null +++ b/desk.gd.uid @@ -0,0 +1 @@ +uid://d2ophrxm0wtr6 diff --git a/desk.tscn b/desk.tscn index c97cffd..de7b2fe 100644 --- a/desk.tscn +++ b/desk.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=29 format=3 uid="uid://bohp0o2smdkwe"] +[gd_scene load_steps=30 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://d2ophrxm0wtr6" path="res://desk.gd" id="1_yugeg"] [ext_resource type="Script" uid="uid://l7wiwo13pb0f" path="res://numpad.gd" id="2_t5y75"] [ext_resource type="PackedScene" uid="uid://d0iltvfnuao1q" path="res://NumpadButton.tscn" id="3_se7ci"] [ext_resource type="Texture2D" uid="uid://cepssq6wpywy5" path="res://assets/numpad/zero.png" id="4_tm3w8"] @@ -29,11 +30,13 @@ [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"] -[node name="Desk" type="Control"] +[node name="Desk" type="Control" node_paths=PackedStringArray("numpad")] layout_mode = 3 anchors_preset = 0 offset_right = 1280.0 offset_bottom = 720.0 +script = ExtResource("1_yugeg") +numpad = NodePath("Numpad") [node name="Gavel" type="Node2D" parent="."] script = ExtResource("1_ep8l3") diff --git a/game_manager.gd b/game_manager.gd index 6b4a0ee..868ff6c 100644 --- a/game_manager.gd +++ b/game_manager.gd @@ -1,4 +1,4 @@ -extends Node2D +class_name GameManager extends Node2D var paintings_sold = 0 var paintings_total = 0 diff --git a/main.tscn b/main.tscn index 560f72e..01d5706 100644 --- a/main.tscn +++ b/main.tscn @@ -1,11 +1,36 @@ -[gd_scene load_steps=3 format=3 uid="uid://dt4nq0nkmjiit"] +[gd_scene load_steps=7 format=3 uid="uid://dt4nq0nkmjiit"] [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="PackedScene" uid="uid://bohp0o2smdkwe" path="res://desk.tscn" id="2_0xm2m"] +[ext_resource type="Texture2D" uid="uid://cpj3xw8js3h3" path="res://assets/chairs/chairs_back.png" id="2_7mycd"] +[ext_resource type="Texture2D" uid="uid://d03ot1f34pyhu" path="res://assets/chairs/chairs_front.png" id="3_272bh"] +[ext_resource type="Script" uid="uid://b1p0muntqup8a" path="res://audience_manager.gd" id="6_7mycd"] [node name="Node2D" type="Node2D"] +[node name="Background" type="Sprite2D" parent="."] +position = Vector2(640, 360) +texture = ExtResource("1_lquwl") + +[node name="Chairs" type="Node2D" parent="."] + +[node name="ChairsBack" type="Sprite2D" parent="Chairs"] +position = Vector2(640, 360) +texture = ExtResource("2_7mycd") + +[node name="ChairsFront" type="Sprite2D" parent="Chairs"] +position = Vector2(640, 360) +texture = ExtResource("3_272bh") + [node name="GameManager" type="Node2D" parent="."] script = ExtResource("1_ig7tw") [node name="Desk" parent="." instance=ExtResource("2_0xm2m")] + +[node name="AudienceManager" type="Node2D" parent="." node_paths=PackedStringArray("desk", "timer")] +script = ExtResource("6_7mycd") +desk = NodePath("../Desk") +timer = NodePath("BidDelayTimer") + +[node name="BidDelayTimer" type="Timer" parent="AudienceManager"] diff --git a/numpad.gd b/numpad.gd index 5545b23..be70b9d 100644 --- a/numpad.gd +++ b/numpad.gd @@ -1,7 +1,8 @@ class_name Numpad extends Node2D var numpad_buffer = Array() -var proposed_bid: int +var proposed_ask: int +signal ask_proposed # number entry function called by numbered button children func keypad_entry(entry: int): @@ -12,4 +13,5 @@ func keypad_backspace(): func keypad_submit(): var keypad_output: String = "".join(numpad_buffer) - proposed_bid = int(keypad_output) + proposed_ask = int(keypad_output) + ask_proposed.emit()