Implement auctioneer barks, paddle raising animations, and normal paddle sounds

This commit is contained in:
Dylan Shumway 2025-10-05 21:46:21 -04:00
parent f4f736b247
commit 5601b8b7c3
25 changed files with 459 additions and 4 deletions

View file

@ -2,11 +2,18 @@ class_name ArtCollector extends Node2D
func _ready() -> void: func _ready() -> void:
$ArtCollectorAnimations.set_frame(randi_range(0, 16)) $ArtCollectorAnimations.set_frame(randi_range(0, 16))
#$ArtCollectorAnimations.animation_finished.connect(_handle_anim_finish)
func normal_paddle(): func normal_paddle():
$ArtCollectorAnimations.play("NormalPaddle") $ArtCollectorAnimations.play("NormalPaddle")
$NormalPaddleSound.play()
await $ArtCollectorAnimations.animation_finished
$ArtCollectorAnimations.play("Idle") $ArtCollectorAnimations.play("Idle")
func critical_paddle(): func critical_paddle():
$ArtCollectorAnimations.play("CriticalPaddle") $ArtCollectorAnimations.play("CriticalPaddle")
await $ArtCollectorAnimations.animation_finished
$ArtCollectorAnimations.play("Idle") $ArtCollectorAnimations.play("Idle")
#func _handle_anim_finish

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=47 format=3 uid="uid://dnuvh3k5qxs63"] [gd_scene load_steps=48 format=3 uid="uid://dnuvh3k5qxs63"]
[ext_resource type="Script" uid="uid://bbi0th2aq426c" path="res://art_collector.gd" id="1_dsoqt"] [ext_resource type="Script" uid="uid://bbi0th2aq426c" path="res://art_collector.gd" id="1_dsoqt"]
[ext_resource type="Texture2D" uid="uid://clrqm1hxhq7ru" path="res://assets/character/collector.png" id="1_y6o5m"] [ext_resource type="Texture2D" uid="uid://clrqm1hxhq7ru" path="res://assets/character/collector.png" id="1_y6o5m"]
[ext_resource type="AudioStream" uid="uid://b6wb4yjtofbhn" path="res://assets/character/paddle-final.wav" id="3_erevg"]
[sub_resource type="AtlasTexture" id="AtlasTexture_5k0jt"] [sub_resource type="AtlasTexture" id="AtlasTexture_5k0jt"]
atlas = ExtResource("1_y6o5m") atlas = ExtResource("1_y6o5m")
@ -346,10 +347,13 @@ animations = [{
"speed": 24.0 "speed": 24.0
}] }]
[node name="ArtCollector" type="Node2D"] [node name="ArtCollector" type="Node2D" groups=["ArtCollectors"]]
script = ExtResource("1_dsoqt") script = ExtResource("1_dsoqt")
[node name="ArtCollectorAnimations" type="AnimatedSprite2D" parent="."] [node name="ArtCollectorAnimations" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_5k0jt") sprite_frames = SubResource("SpriteFrames_5k0jt")
animation = &"Idle" animation = &"Idle"
autoplay = "Idle" autoplay = "Idle"
[node name="NormalPaddleSound" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_erevg")

BIN
assets/buttons/button1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://d2142cf22t1lv"
path="res://.godot/imported/button1.png-15ecc5a379d05a09ff3d3ef57734003f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/buttons/button1.png"
dest_files=["res://.godot/imported/button1.png-15ecc5a379d05a09ff3d3ef57734003f.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 934 B

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ut655l8y8xmi"
path="res://.godot/imported/button1pressed.png-8f21e92cc660418336dacc1fd3a586b8.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/buttons/button1pressed.png"
dest_files=["res://.godot/imported/button1pressed.png-8f21e92cc660418336dacc1fd3a586b8.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

BIN
assets/buttons/button2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://14hw6p3ck5e7"
path="res://.godot/imported/button2.png-977da571c0c0674ade0ff155355947c0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/buttons/button2.png"
dest_files=["res://.godot/imported/button2.png-977da571c0c0674ade0ff155355947c0.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dve6bedyuod2b"
path="res://.godot/imported/button2pressed.png-bf2e3ce8624b23d5a97bb006fa6d71ad.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/buttons/button2pressed.png"
dest_files=["res://.godot/imported/button2pressed.png-bf2e3ce8624b23d5a97bb006fa6d71ad.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

BIN
assets/buttons/button3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c0iad21xtnjdd"
path="res://.godot/imported/button3.png-d1bfadcdb2bc4f4daf3dae71f6f7d6ce.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/buttons/button3.png"
dest_files=["res://.godot/imported/button3.png-d1bfadcdb2bc4f4daf3dae71f6f7d6ce.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dx4dadmb37khl"
path="res://.godot/imported/button3pressed.png-966c70496c1a93a452a3a3f34bcc4669.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/buttons/button3pressed.png"
dest_files=["res://.godot/imported/button3pressed.png-966c70496c1a93a452a3a3f34bcc4669.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

BIN
assets/buttons/button4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://heqlxtsfl26k"
path="res://.godot/imported/button4.png-b84c84499d6f1406182d5830a560d341.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/buttons/button4.png"
dest_files=["res://.godot/imported/button4.png-b84c84499d6f1406182d5830a560d341.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bnjj1gp2jx82x"
path="res://.godot/imported/button4pressed.png-ee55f3eaec17cbd55e4e554e54973bc6.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/buttons/button4pressed.png"
dest_files=["res://.godot/imported/button4pressed.png-ee55f3eaec17cbd55e4e554e54973bc6.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

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://b6wb4yjtofbhn"
path="res://.godot/imported/paddle-final.wav-fb195d6fffc4904030c6bccfd2ed9b4f.sample"
[deps]
source_file="res://assets/character/paddle-final.wav"
dest_files=["res://.godot/imported/paddle-final.wav-fb195d6fffc4904030c6bccfd2ed9b4f.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

View file

@ -3,8 +3,10 @@ class_name AudienceManager extends Node2D
@export var desk: Desk @export var desk: Desk
@export var timer: Timer @export var timer: Timer
@export var game_manager: GameManager @export var game_manager: GameManager
@export var bark_buttons: BarkButtons
signal ask_accepted signal ask_accepted
var bark_critical := false
#ideally variable for influencing how much the audience responds to barks #ideally variable for influencing how much the audience responds to barks
@export var audience_susceptibility := 0.4: @export var audience_susceptibility := 0.4:
@ -27,15 +29,32 @@ var current_ask: int
func _ready() -> void: func _ready() -> void:
desk.numpad.ask_proposed.connect(_handle_ask_proposed) desk.numpad.ask_proposed.connect(_handle_ask_proposed)
timer.timeout.connect(_handle_bid_delay_timeout) timer.timeout.connect(_handle_bid_delay_timeout)
bark_buttons.auctioneer_bark.connect(_handle_auctioneer_bark)
func raise_paddle(): func raise_paddle():
#need to add in logic to animate paddle being raised #need to add in logic to animate paddle being raised
game_manager.state = game_manager.bidding_state.BID game_manager.state = game_manager.bidding_state.BID
print("Audience accepts the bid at $" + str(current_ask)) print("Audience accepts the bid at $" + str(current_ask))
game_manager.current_bid = desk.numpad.proposed_ask game_manager.current_bid = desk.numpad.proposed_ask
var collectors: Array[Node] = get_tree().get_nodes_in_group("ArtCollectors")
collectors.shuffle()
if bark_critical:
collectors[0].critical_paddle()
print("play crit paddle")
else:
collectors[0].normal_paddle()
print("play norm paddle")
bark_critical = false
ask_accepted.emit() ask_accepted.emit()
func _handle_auctioneer_bark():
if timer.time_left >= think_min_time:
bark_critical = true
timer.stop()
timer.timeout.emit()
pass
func _handle_bid_delay_timeout(): func _handle_bid_delay_timeout():
if game_manager.state == game_manager.bidding_state.ASKING: if game_manager.state == game_manager.bidding_state.ASKING:
if randf_range(1.2, 5.3) >= bid_threshold: if randf_range(1.2, 5.3) >= bid_threshold:

21
bark_buttons.gd Normal file
View file

@ -0,0 +1,21 @@
class_name BarkButtons extends Node2D
signal auctioneer_bark
@export var turn_manager: TurnManager
@export var bark_speed = 2.0
func _on_great_buy_button_down() -> void:
auctioneer_bark.emit()
DisplayServer.tts_speak("Great buy!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch, bark_speed)
func _on_investment_piece_button_down() -> void:
auctioneer_bark.emit()
DisplayServer.tts_speak("Investment piece!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch, bark_speed)
func _on_stunning_message_button_down() -> void:
auctioneer_bark.emit()
DisplayServer.tts_speak("Stunning message!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch, bark_speed)
func _on_innovative_artist_button_down() -> void:
auctioneer_bark.emit()
DisplayServer.tts_speak("Innovative artist!", turn_manager.voice_id, turn_manager.tts_volume, turn_manager.tts_pitch, bark_speed)

1
bark_buttons.gd.uid Normal file
View file

@ -0,0 +1 @@
uid://bg1vk1o2eq3fg

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=10 format=3 uid="uid://dt4nq0nkmjiit"] [gd_scene load_steps=19 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"]
@ -8,6 +8,15 @@
[ext_resource type="Texture2D" uid="uid://d03ot1f34pyhu" path="res://assets/chairs/chairs_front.png" id="3_272bh"] [ext_resource type="Texture2D" uid="uid://d03ot1f34pyhu" path="res://assets/chairs/chairs_front.png" id="3_272bh"]
[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="Texture2D" uid="uid://d2142cf22t1lv" path="res://assets/buttons/button1.png" id="9_2cqfq"]
[ext_resource type="Script" uid="uid://bg1vk1o2eq3fg" path="res://bark_buttons.gd" id="9_yaehf"]
[ext_resource type="Texture2D" uid="uid://ut655l8y8xmi" path="res://assets/buttons/button1pressed.png" id="10_yaehf"]
[ext_resource type="Texture2D" uid="uid://c0iad21xtnjdd" path="res://assets/buttons/button3.png" id="11_074og"]
[ext_resource type="Texture2D" uid="uid://dx4dadmb37khl" path="res://assets/buttons/button3pressed.png" id="12_cegan"]
[ext_resource type="Texture2D" uid="uid://14hw6p3ck5e7" path="res://assets/buttons/button2.png" id="13_82xsv"]
[ext_resource type="Texture2D" uid="uid://dve6bedyuod2b" path="res://assets/buttons/button2pressed.png" id="14_getpj"]
[ext_resource type="Texture2D" uid="uid://heqlxtsfl26k" path="res://assets/buttons/button4.png" id="15_ryguw"]
[ext_resource type="Texture2D" uid="uid://bnjj1gp2jx82x" path="res://assets/buttons/button4pressed.png" id="16_d13ii"]
[sub_resource type="Theme" id="Theme_272bh"] [sub_resource type="Theme" id="Theme_272bh"]
default_font = ExtResource("2_5vw27") default_font = ExtResource("2_5vw27")
@ -59,12 +68,58 @@ text = "Current Bid: $0"
horizontal_alignment = 1 horizontal_alignment = 1
vertical_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", "bark_buttons") instance=ExtResource("6_272bh")]
desk = NodePath("../Desk") desk = NodePath("../Desk")
game_manager = NodePath("../GameManager") game_manager = NodePath("../GameManager")
bark_buttons = NodePath("../BarkButtons")
[node name="TurnManager" parent="." node_paths=PackedStringArray("desk", "game_manager", "audience_manager") instance=ExtResource("7_272bh")] [node name="TurnManager" parent="." node_paths=PackedStringArray("desk", "game_manager", "audience_manager") instance=ExtResource("7_272bh")]
tts_sentence_speed = 4.5 tts_sentence_speed = 4.5
desk = NodePath("../Desk") desk = NodePath("../Desk")
game_manager = NodePath("../GameManager") game_manager = NodePath("../GameManager")
audience_manager = NodePath("../AudienceManager") audience_manager = NodePath("../AudienceManager")
[node name="BarkButtons" type="Node2D" parent="." node_paths=PackedStringArray("turn_manager")]
position = Vector2(180, 500)
script = ExtResource("9_yaehf")
turn_manager = NodePath("../TurnManager")
[node name="GreatBuy" type="TextureButton" parent="BarkButtons"]
offset_top = -14.0
offset_right = 100.0
offset_bottom = 86.0
texture_normal = ExtResource("9_2cqfq")
texture_pressed = ExtResource("10_yaehf")
texture_hover = ExtResource("10_yaehf")
[node name="InvestmentPiece" type="TextureButton" parent="BarkButtons"]
offset_left = -98.0
offset_top = 47.0
offset_right = 2.0
offset_bottom = 147.0
texture_normal = ExtResource("11_074og")
texture_pressed = ExtResource("12_cegan")
texture_hover = ExtResource("12_cegan")
[node name="StunningMessage" type="TextureButton" parent="BarkButtons"]
offset_left = -4.0
offset_top = 103.0
offset_right = 96.0
offset_bottom = 203.0
texture_normal = ExtResource("13_82xsv")
texture_pressed = ExtResource("14_getpj")
texture_hover = ExtResource("14_getpj")
[node name="InnovativeArtist" type="TextureButton" parent="BarkButtons"]
offset_left = 92.0
offset_top = 43.0
offset_right = 192.0
offset_bottom = 143.0
texture_normal = ExtResource("15_ryguw")
texture_pressed = ExtResource("16_d13ii")
texture_hover = ExtResource("16_d13ii")
[connection signal="button_down" from="BarkButtons/GreatBuy" to="BarkButtons" method="_on_great_buy_button_down"]
[connection signal="button_down" from="BarkButtons/InvestmentPiece" to="BarkButtons" method="_on_investment_piece_button_down"]
[connection signal="button_down" from="BarkButtons/StunningMessage" to="BarkButtons" method="_on_stunning_message_button_down"]
[connection signal="button_down" from="BarkButtons/InnovativeArtist" to="BarkButtons" method="_on_innovative_artist_button_down"]

View file

@ -26,6 +26,10 @@ window/size/viewport_height=720
window/stretch/mode="viewport" window/stretch/mode="viewport"
window/stretch/scale_mode="integer" window/stretch/scale_mode="integer"
[global_group]
ArtCollectors=""
[rendering] [rendering]
textures/vram_compression/import_etc2_astc=true textures/vram_compression/import_etc2_astc=true