diff --git a/assets/buttons/button_down.png b/assets/buttons/button_down.png new file mode 100644 index 0000000..6b00378 Binary files /dev/null and b/assets/buttons/button_down.png differ diff --git a/assets/buttons/button_down.png.import b/assets/buttons/button_down.png.import new file mode 100644 index 0000000..d33802f --- /dev/null +++ b/assets/buttons/button_down.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bdjfior4od5ub" +path="res://.godot/imported/button_down.png-b31c37be4e6104f2104294b39e187e63.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/buttons/button_down.png" +dest_files=["res://.godot/imported/button_down.png-b31c37be4e6104f2104294b39e187e63.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/buttons/button_up.png b/assets/buttons/button_up.png new file mode 100644 index 0000000..6ed0781 Binary files /dev/null and b/assets/buttons/button_up.png differ diff --git a/assets/buttons/button_up.png.import b/assets/buttons/button_up.png.import new file mode 100644 index 0000000..f105f02 --- /dev/null +++ b/assets/buttons/button_up.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b6n841u18dddv" +path="res://.godot/imported/button_up.png-f7cb27de2290ecb73ba32e69aaaaea39.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/buttons/button_up.png" +dest_files=["res://.godot/imported/button_up.png-f7cb27de2290ecb73ba32e69aaaaea39.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 index 7a1244a..c42a00b 100644 --- a/audience_manager.gd +++ b/audience_manager.gd @@ -3,7 +3,6 @@ class_name AudienceManager extends Node2D @export var desk: Desk @export var timer: Timer @export var game_manager: GameManager -@export var bark_buttons: BarkButtons signal ask_accepted var bark_critical := false @@ -31,7 +30,7 @@ var latest_bidder: ArtCollector func _ready() -> void: desk.numpad.ask_proposed.connect(_handle_ask_proposed) timer.timeout.connect(_handle_bid_delay_timeout) - bark_buttons.auctioneer_bark.connect(_handle_auctioneer_bark) + desk.bark.bark.connect(_handle_auctioneer_bark) desk.numpad.reminder_timer.timeout.connect(try_clear_currently_animated_collector) desk.gavel.gavel_hit.connect(try_clear_currently_animated_collector) diff --git a/bark.gd b/bark.gd new file mode 100644 index 0000000..1c2cddc --- /dev/null +++ b/bark.gd @@ -0,0 +1,28 @@ +class_name Bark extends Node2D + +@export var bark_speed = 4.0 + +var turn_manager: TurnManager +signal bark + + +func _on_bark_button_pressed() -> void: + bark.emit() + + var chance = randf() + if chance < 0.25: + turn_manager.speak_bark("It's an investment piece!", bark_speed) + elif chance < 0.5: + turn_manager.speak_bark("It's an innovative artist!", bark_speed) + elif chance < 0.75: + turn_manager.speak_bark("It's a stunning message!", bark_speed) + else: + turn_manager.speak_bark("It's a great buy!", bark_speed) + + +func _on_bark_button_button_down() -> void: + $BarkButton.mouse_default_cursor_shape = Control.CURSOR_DRAG + + +func _on_bark_button_button_up() -> void: + $BarkButton.mouse_default_cursor_shape = Control.CURSOR_ARROW diff --git a/bark.gd.uid b/bark.gd.uid new file mode 100644 index 0000000..d071009 --- /dev/null +++ b/bark.gd.uid @@ -0,0 +1 @@ +uid://cwnif1u23aa2 diff --git a/desk.gd b/desk.gd index 81a3579..f5eb1b0 100644 --- a/desk.gd +++ b/desk.gd @@ -5,8 +5,10 @@ class_name Desk extends Control @export var turn_manager: TurnManager @export var audience_manager: AudienceManager @export var gavel: Gavel +@export var bark: Bark func _ready() -> void: numpad.turn_manager = turn_manager numpad.game_manager = game_manager numpad.audience_manager = audience_manager + bark.turn_manager = turn_manager diff --git a/desk.tscn b/desk.tscn index 19ef5ec..f1cc644 100644 --- a/desk.tscn +++ b/desk.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=57 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://d2ophrxm0wtr6" path="res://desk.gd" id="1_yugeg"] @@ -53,6 +53,9 @@ [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://bq5yl788b424g" path="res://assets/numpad/ask-bet-final.wav" id="53_mq8ri"] +[ext_resource type="Script" uid="uid://cwnif1u23aa2" path="res://bark.gd" id="54_bxpdm"] +[ext_resource type="Texture2D" uid="uid://b6n841u18dddv" path="res://assets/buttons/button_up.png" id="55_8sdgr"] +[ext_resource type="Texture2D" uid="uid://bdjfior4od5ub" path="res://assets/buttons/button_down.png" id="56_k4eer"] [sub_resource type="SpriteFrames" id="SpriteFrames_g470s"] animations = [{ @@ -149,7 +152,7 @@ bg_color = Color(0.5109665, 0, 0.077832855, 1) [sub_resource type="Theme" id="Theme_8sdgr"] ProgressBar/styles/fill = SubResource("StyleBoxFlat_8sdgr") -[node name="Desk" type="Control" node_paths=PackedStringArray("numpad", "gavel")] +[node name="Desk" type="Control" node_paths=PackedStringArray("numpad", "gavel", "bark")] layout_mode = 3 anchors_preset = 0 offset_right = 1280.0 @@ -157,6 +160,7 @@ offset_bottom = 720.0 script = ExtResource("1_yugeg") numpad = NodePath("Numpad") gavel = NodePath("Gavel") +bark = NodePath("Bark") [node name="Gavel" type="Node2D" parent="." node_paths=PackedStringArray("audio_player")] position = Vector2(825, 300) @@ -319,7 +323,28 @@ theme = SubResource("Theme_8sdgr") theme_type_variation = &"Red" show_percentage = false +[node name="Bark" type="Node2D" parent="."] +script = ExtResource("54_bxpdm") + +[node name="BarkButton" type="TextureButton" parent="Bark"] +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = 31.0 +offset_top = 348.0 +offset_right = 431.0 +offset_bottom = 748.0 +grow_horizontal = 2 +grow_vertical = 2 +texture_normal = ExtResource("55_8sdgr") +texture_pressed = ExtResource("56_k4eer") + [connection signal="button_down" from="Gavel/TextureButton" to="Gavel" method="_on_texture_button_button_down"] [connection signal="button_up" from="Gavel/TextureButton" to="Gavel" method="_on_texture_button_button_release"] [connection signal="mouse_entered" from="Gavel/TextureButton" to="Gavel" method="_on_texture_button_mouse_entered"] [connection signal="mouse_exited" from="Gavel/TextureButton" to="Gavel" method="_on_texture_button_mouse_exited"] +[connection signal="button_down" from="Bark/BarkButton" to="Bark" method="_on_bark_button_button_down"] +[connection signal="button_up" from="Bark/BarkButton" to="Bark" method="_on_bark_button_button_up"] +[connection signal="pressed" from="Bark/BarkButton" to="Bark" method="_on_bark_button_pressed"] diff --git a/main.tscn b/main.tscn index 7f28467..84fd2d9 100644 --- a/main.tscn +++ b/main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=27 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="Texture2D" uid="uid://cvqsf1nlfqwpr" path="res://assets/background/background.png" id="1_lquwl"] @@ -12,16 +12,7 @@ [ext_resource type="AudioStream" uid="uid://cicodo74wnevu" path="res://assets/game sfx/next-round.wav" id="6_82xsv"] [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="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="Script" uid="uid://sfhg7pkumnwa" path="res://captions.gd" id="10_ryguw"] -[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"] +[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"] @@ -129,54 +120,13 @@ script = ExtResource("10_ryguw") [node name="AudienceManager" parent="." node_paths=PackedStringArray("desk", "game_manager", "bark_buttons") instance=ExtResource("6_272bh")] desk = NodePath("../Desk") game_manager = NodePath("../GameManager") -bark_buttons = NodePath("../BarkButtons") +bark_buttons = NodePath("") [node name="TurnManager" parent="." node_paths=PackedStringArray("desk", "captions", "audience_manager") instance=ExtResource("7_272bh")] -tts_sentence_speed = 4.5 desk = NodePath("../Desk") captions = NodePath("../UI/Captions") 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") - [node name="CursorManager" parent="." instance=ExtResource("20_82xsv")] [node name="BackgroundMusic" type="AudioStreamPlayer" parent="."] @@ -247,11 +197,3 @@ layout_mode = 2 size_flags_horizontal = 3 [connection signal="timer_timeout" from="TurnManager" to="GameManager" method="_on_turn_manager_timer_timeout"] -[connection signal="button_down" from="BarkButtons/GreatBuy" to="BarkButtons" method="_on_great_buy_button_down"] -[connection signal="button_up" from="BarkButtons/GreatBuy" to="BarkButtons" method="_on_great_buy_button_release"] -[connection signal="button_down" from="BarkButtons/InvestmentPiece" to="BarkButtons" method="_on_investment_piece_button_down"] -[connection signal="button_up" from="BarkButtons/InvestmentPiece" to="BarkButtons" method="_on_investment_piece_button_up"] -[connection signal="button_down" from="BarkButtons/StunningMessage" to="BarkButtons" method="_on_stunning_message_button_down"] -[connection signal="button_up" from="BarkButtons/StunningMessage" to="BarkButtons" method="_on_stunning_message_button_release"] -[connection signal="button_down" from="BarkButtons/InnovativeArtist" to="BarkButtons" method="_on_innovative_artist_button_down"] -[connection signal="button_up" from="BarkButtons/InnovativeArtist" to="BarkButtons" method="_on_innovative_artist_button_release"] diff --git a/world.gd.uid b/world.gd.uid index 2a76f19..46fcb92 100644 --- a/world.gd.uid +++ b/world.gd.uid @@ -1 +1 @@ -uid://btq5lp33qphwg +uid://k52hesjc1onk