Implement background art assets and basic audience_manager
This commit is contained in:
parent
a517ed9f9e
commit
d2f5914acd
14 changed files with 203 additions and 6 deletions
BIN
assets/background/background.png
Normal file
BIN
assets/background/background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
40
assets/background/background.png.import
Normal file
40
assets/background/background.png.import
Normal file
|
|
@ -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
|
||||
BIN
assets/chairs/chairs_back.png
Normal file
BIN
assets/chairs/chairs_back.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
40
assets/chairs/chairs_back.png.import
Normal file
40
assets/chairs/chairs_back.png.import
Normal file
|
|
@ -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
|
||||
BIN
assets/chairs/chairs_front.png
Normal file
BIN
assets/chairs/chairs_front.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
40
assets/chairs/chairs_front.png.import
Normal file
40
assets/chairs/chairs_front.png.import
Normal file
|
|
@ -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
|
||||
42
audience_manager.gd
Normal file
42
audience_manager.gd
Normal file
|
|
@ -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()
|
||||
1
audience_manager.gd.uid
Normal file
1
audience_manager.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b1p0muntqup8a
|
||||
3
desk.gd
Normal file
3
desk.gd
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
class_name Desk extends Control
|
||||
|
||||
@export var numpad: Numpad
|
||||
1
desk.gd.uid
Normal file
1
desk.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://d2ophrxm0wtr6
|
||||
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
extends Node2D
|
||||
class_name GameManager extends Node2D
|
||||
|
||||
var paintings_sold = 0
|
||||
var paintings_total = 0
|
||||
|
|
|
|||
27
main.tscn
27
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"]
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue