Wire up sfx, Sega Master System palette for win/end screen, add start screen

This commit is contained in:
Jennie Robinson Faber 2026-05-17 23:41:16 +01:00
parent 2f1437050a
commit 710ae4268f
13 changed files with 161 additions and 40 deletions

24
audio/block.wav.import Normal file
View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://6u5g67ptqsp4"
path="res://.godot/imported/block.wav-862e14aabfa854dd89f6e45e400ee640.sample"
[deps]
source_file="res://audio/block.wav"
dest_files=["res://.godot/imported/block.wav-862e14aabfa854dd89f6e45e400ee640.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

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://cxvu4rxkgxekb"
path="res://.godot/imported/floor_select.wav-9db728e2a2c96ff78e6dfca8f37fc437.sample"
[deps]
source_file="res://audio/floor_select.wav"
dest_files=["res://.godot/imported/floor_select.wav-9db728e2a2c96ff78e6dfca8f37fc437.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

24
audio/hacked.wav.import Normal file
View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://cyjww14gef86j"
path="res://.godot/imported/hacked.wav-1fd73f8141eb60a20baf48c5d06a02b3.sample"
[deps]
source_file="res://audio/hacked.wav"
dest_files=["res://.godot/imported/hacked.wav-1fd73f8141eb60a20baf48c5d06a02b3.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

@ -45,7 +45,9 @@ func _ready():
_screen.pulse_started.connect(_on_pulse_started) _screen.pulse_started.connect(_on_pulse_started)
_screen.pulse_blocked.connect(_on_pulse_blocked) _screen.pulse_blocked.connect(_on_pulse_blocked)
_screen.pulse_blocked_perfect.connect(_on_pulse_blocked_perfect) _screen.pulse_blocked_perfect.connect(_on_pulse_blocked_perfect)
_screen.doors_closing.connect(func(): _on_doors_closing(true)) _screen.doors_closing.connect(func():
$SfxHacked.play()
_on_doors_closing(true))
EventBus.game_started.connect(_on_game_started) EventBus.game_started.connect(_on_game_started)
EventBus.game_lost.connect(func(_reason): $SfxRobotIUnderstand.play()) EventBus.game_lost.connect(func(_reason): $SfxRobotIUnderstand.play())
@ -167,6 +169,7 @@ func _enter_static_then_hacked(token: int) -> void:
return return
state = ScreenState.HACKED state = ScreenState.HACKED
_dbg("HACKED") _dbg("HACKED")
$SfxHacked.play()
_screen.enter_hacked() _screen.enter_hacked()
EventBus.active_button_changed.emit("open"), EventBus.active_button_changed.emit("open"),
CONNECT_ONE_SHOT CONNECT_ONE_SHOT

View file

@ -40,14 +40,16 @@ func _on_game_lost(_reason: String):
_run_intro_sequence() _run_intro_sequence()
func _apply_loss_palette(): func _apply_loss_palette():
var border := Color(1, 0.3, 0.3, 1) var headline := Color(0.949, 0.227, 0.541, 1)
var subtle := Color(0.95, 0.7, 0.7, 1) var body := Color(0.851, 0.541, 0.659, 1)
var hint := Color(0.941, 0.761, 0.831, 1)
$Dim.color = Color(0.18, 0.05, 0.05, 1) $Dim.color = Color(0.078, 0.031, 0.18, 1)
$Center/Card/Margin/Column/Headline.add_theme_color_override("font_color", border) $Center/Card/Margin/Column/Headline.add_theme_color_override("font_color", headline)
$Center/Card/Margin/Column/ScoreLabel.add_theme_color_override("font_color", subtle) $Center/Card/Margin/Column/ScoreLabel.add_theme_color_override("font_color", body)
$Center/Card/Margin/Column/SavedLabel.add_theme_color_override("font_color", subtle) $Center/Card/Margin/Column/SavedLabel.add_theme_color_override("font_color", body)
$Center/Card/Margin/Column/SpaceHint.add_theme_color_override("font_color", hint)
func _run_intro_sequence() -> void: func _run_intro_sequence() -> void:
$Center/Card/Margin/Column/ScoreLabel.text = Strings.END_SCORE_FMT % _score $Center/Card/Margin/Column/ScoreLabel.text = Strings.END_SCORE_FMT % _score
@ -81,5 +83,9 @@ func _run_intro_sequence() -> void:
_ready_for_input = true _ready_for_input = true
var flash_tween := create_tween().set_loops()
flash_tween.tween_property($Center/Card/Margin/Column/SpaceHint, "modulate:a", 0.2, 0.6).set_trans(Tween.TRANS_SINE)
flash_tween.tween_property($Center/Card/Margin/Column/SpaceHint, "modulate:a", 1.0, 0.6).set_trans(Tween.TRANS_SINE)
func _on_restart_pressed(): func _on_restart_pressed():
get_tree().reload_current_scene() get_tree().reload_current_scene()

View file

@ -12,7 +12,7 @@ anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
mouse_filter = 2 mouse_filter = 2
color = Color(0.05, 0.18, 0.05, 1) color = Color(0.102, 0.251, 0.278, 1)
[node name="BlackFade" type="ColorRect" parent="."] [node name="BlackFade" type="ColorRect" parent="."]
anchors_preset = 15 anchors_preset = 15
@ -42,23 +42,23 @@ theme_override_constants/separation = 24
[node name="Headline" type="Label" parent="Center/Card/Margin/Column"] [node name="Headline" type="Label" parent="Center/Card/Margin/Column"]
text = "YOU ESCAPED" text = "YOU ESCAPED"
horizontal_alignment = 1 horizontal_alignment = 1
theme_override_colors/font_color = Color(0.2, 1, 0.2, 1) theme_override_colors/font_color = Color(0.553, 0.91, 1, 1)
theme_override_font_sizes/font_size = 56 theme_override_font_sizes/font_size = 56
[node name="ScoreLabel" type="Label" parent="Center/Card/Margin/Column"] [node name="ScoreLabel" type="Label" parent="Center/Card/Margin/Column"]
text = "Score: 0" text = "Score: 0"
horizontal_alignment = 1 horizontal_alignment = 1
theme_override_colors/font_color = Color(0.7, 0.95, 0.7, 1) theme_override_colors/font_color = Color(0.659, 1, 0.8, 1)
theme_override_font_sizes/font_size = 28 theme_override_font_sizes/font_size = 28
[node name="SavedLabel" type="Label" parent="Center/Card/Margin/Column"] [node name="SavedLabel" type="Label" parent="Center/Card/Margin/Column"]
text = "Survivors saved: 0" text = "Survivors saved: 0"
horizontal_alignment = 1 horizontal_alignment = 1
theme_override_colors/font_color = Color(0.7, 0.95, 0.7, 1) theme_override_colors/font_color = Color(0.659, 1, 0.8, 1)
theme_override_font_sizes/font_size = 28 theme_override_font_sizes/font_size = 28
[node name="SpaceHint" type="Label" parent="Center/Card/Margin/Column"] [node name="SpaceHint" type="Label" parent="Center/Card/Margin/Column"]
text = "Space to Restart" text = "Space to Restart"
horizontal_alignment = 1 horizontal_alignment = 1
theme_override_colors/font_color = Color(0.95, 0.7, 0.7, 1) theme_override_colors/font_color = Color(0.961, 1, 0.851, 1)
theme_override_font_sizes/font_size = 20 theme_override_font_sizes/font_size = 20

View file

@ -14,11 +14,13 @@
[ext_resource type="PackedScene" path="res://scenes/end_screen.tscn" id="10_endsc"] [ext_resource type="PackedScene" path="res://scenes/end_screen.tscn" id="10_endsc"]
[ext_resource type="AudioStream" uid="uid://dln0g1bnjh1of" path="res://audio/Robot - I Understand.wav" id="10_under"] [ext_resource type="AudioStream" uid="uid://dln0g1bnjh1of" path="res://audio/Robot - I Understand.wav" id="10_under"]
[ext_resource type="AudioStream" uid="uid://bwovhu6jfk0vt" path="res://audio/Robot - Thank You.wav" id="11_thx"] [ext_resource type="AudioStream" uid="uid://bwovhu6jfk0vt" path="res://audio/Robot - Thank You.wav" id="11_thx"]
[ext_resource type="PackedScene" uid="uid://sgakdvtoblmd" path="res://scenes/title_screen.tscn" id="11_title"] [ext_resource type="PackedScene" uid="uid://bbw2sfptheq4u" path="res://scenes/start_screen.tscn" id="11_title"]
[ext_resource type="AudioStream" uid="uid://b3d6rntbosvc6" path="res://audio/Ambience.wav" id="12_amb"] [ext_resource type="AudioStream" uid="uid://b3d6rntbosvc6" path="res://audio/Ambience.wav" id="12_amb"]
[ext_resource type="PackedScene" path="res://scenes/pause_menu.tscn" id="12_pause"] [ext_resource type="PackedScene" path="res://scenes/pause_menu.tscn" id="12_pause"]
[ext_resource type="AudioStream" uid="uid://cnfmytsyo8biq" path="res://audio/RoboZacSpeaker.wav" id="13_muzak"] [ext_resource type="AudioStream" uid="uid://cnfmytsyo8biq" path="res://audio/RoboZacSpeaker.wav" id="13_muzak"]
[ext_resource type="Script" uid="uid://deyjxii7yykjv" path="res://scenes/muzak.gd" id="14_muzak_s"] [ext_resource type="Script" uid="uid://deyjxii7yykjv" path="res://scenes/muzak.gd" id="14_muzak_s"]
[ext_resource type="AudioStream" uid="uid://6u5g67ptqsp4" path="res://audio/block.wav" id="15_block"]
[ext_resource type="AudioStream" uid="uid://cyjww14gef86j" path="res://audio/hacked.wav" id="16_hacked"]
[node name="Game" type="Node3D" unique_id=1456297160] [node name="Game" type="Node3D" unique_id=1456297160]
script = ExtResource("1_lbhrr") script = ExtResource("1_lbhrr")
@ -64,6 +66,12 @@ stream = ExtResource("10_under")
stream = ExtResource("11_thx") stream = ExtResource("11_thx")
[node name="SfxBlock" type="AudioStreamPlayer3D" parent="CanvasPanel/ElevatorPanel" unique_id=1100000007] [node name="SfxBlock" type="AudioStreamPlayer3D" parent="CanvasPanel/ElevatorPanel" unique_id=1100000007]
stream = ExtResource("15_block")
max_polyphony = 4
[node name="SfxHacked" type="AudioStreamPlayer3D" parent="CanvasPanel/ElevatorPanel" unique_id=1100000008]
stream = ExtResource("16_hacked")
max_polyphony = 4
[node name="Ambience" type="AudioStreamPlayer" parent="." unique_id=1100000005] [node name="Ambience" type="AudioStreamPlayer" parent="." unique_id=1100000005]
process_mode = 3 process_mode = 3
@ -80,7 +88,11 @@ script = ExtResource("14_muzak_s")
[node name="EndScreen" parent="." unique_id=993175156 instance=ExtResource("10_endsc")] [node name="EndScreen" parent="." unique_id=993175156 instance=ExtResource("10_endsc")]
[node name="TitleScreen" parent="." unique_id=1656317143 instance=ExtResource("11_title")] [node name="TitleScreen" type="CanvasLayer" parent="." unique_id=1656317143]
process_mode = 3
layer = 20
[node name="StartScreen" parent="TitleScreen" instance=ExtResource("11_title")]
[node name="PauseMenu" parent="." unique_id=1244164419 instance=ExtResource("12_pause")] [node name="PauseMenu" parent="." unique_id=1244164419 instance=ExtResource("12_pause")]

View file

@ -119,6 +119,7 @@ func _update_intro_progress(progress: float) -> void:
func _light_button(index: int) -> void: func _light_button(index: int) -> void:
var sprite: Sprite3D = _buttons[index].get_node("ButtonSprite") var sprite: Sprite3D = _buttons[index].get_node("ButtonSprite")
sprite.frame = index + 10 sprite.frame = index + 10
$SfxFloorSelect.play()
func _set_all_lit(lit: bool) -> void: func _set_all_lit(lit: bool) -> void:
for i in range(_buttons.size()): for i in range(_buttons.size()):

View file

@ -2,6 +2,7 @@
[ext_resource type="Texture2D" path="res://images/virtua_hand_left.png" id="1_lhand"] [ext_resource type="Texture2D" path="res://images/virtua_hand_left.png" id="1_lhand"]
[ext_resource type="Script" path="res://scenes/left_hand.gd" id="2_lhscr"] [ext_resource type="Script" path="res://scenes/left_hand.gd" id="2_lhscr"]
[ext_resource type="AudioStream" uid="uid://cxvu4rxkgxekb" path="res://audio/floor_select.wav" id="3_fsel"]
[node name="LeftHand" type="Sprite3D"] [node name="LeftHand" type="Sprite3D"]
billboard = 1 billboard = 1
@ -9,3 +10,7 @@ texture_filter = 0
alpha_cut = 1 alpha_cut = 1
texture = ExtResource("1_lhand") texture = ExtResource("1_lhand")
script = ExtResource("2_lhscr") script = ExtResource("2_lhscr")
[node name="SfxFloorSelect" type="AudioStreamPlayer3D" parent="."]
stream = ExtResource("3_fsel")
max_polyphony = 16

View file

@ -12,7 +12,7 @@ anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
mouse_filter = 2 mouse_filter = 2
color = Color(0.05, 0.18, 0.05, 1) color = Color(0.102, 0.251, 0.278, 1)
[node name="Center" type="CenterContainer" parent="."] [node name="Center" type="CenterContainer" parent="."]
anchors_preset = 15 anchors_preset = 15
@ -34,17 +34,17 @@ theme_override_constants/separation = 24
[node name="Title" type="Label" parent="Center/Card/Margin/Column"] [node name="Title" type="Label" parent="Center/Card/Margin/Column"]
text = "PAUSED" text = "PAUSED"
horizontal_alignment = 1 horizontal_alignment = 1
theme_override_colors/font_color = Color(0.2, 1, 0.2, 1) theme_override_colors/font_color = Color(0.553, 0.91, 1, 1)
theme_override_font_sizes/font_size = 56 theme_override_font_sizes/font_size = 56
[node name="SpaceHint" type="Label" parent="Center/Card/Margin/Column"] [node name="SpaceHint" type="Label" parent="Center/Card/Margin/Column"]
text = "Space to Resume" text = "Space to Resume"
horizontal_alignment = 1 horizontal_alignment = 1
theme_override_colors/font_color = Color(0.7, 0.95, 0.7, 1) theme_override_colors/font_color = Color(0.659, 1, 0.8, 1)
theme_override_font_sizes/font_size = 20 theme_override_font_sizes/font_size = 20
[node name="RestartHint" type="Label" parent="Center/Card/Margin/Column"] [node name="RestartHint" type="Label" parent="Center/Card/Margin/Column"]
text = "R to Restart" text = "R to Restart"
horizontal_alignment = 1 horizontal_alignment = 1
theme_override_colors/font_color = Color(0.7, 0.95, 0.7, 1) theme_override_colors/font_color = Color(0.659, 1, 0.8, 1)
theme_override_font_sizes/font_size = 20 theme_override_font_sizes/font_size = 20

View file

@ -2,15 +2,16 @@ extends CharacterBody3D
const STALK_DARK_DISTANCE := 19.0 const STALK_DARK_DISTANCE := 19.0
const STALK_ILLUMINATE_DISTANCE := 15.0 const STALK_ILLUMINATE_DISTANCE := 15.0
const WALK_IN_DURATION := 1.5
var robot_ready: bool = false
var robot_win: bool = false var robot_win: bool = false
var speed: float = 1.0 var speed: float = 1.0
var doors_open: bool = true var doors_open: bool = true
var stun_remaining: float = 0.0 var stun_remaining: float = 0.0
var _stalking_close: bool = false var _stalking_close: bool = false
var _walk_in_remaining: float = 0.0
var _game_lost_emitted: bool = false
var _delay_remaining: float = 0.0
var _spawn_transform: Transform3D var _spawn_transform: Transform3D
var safety_zone: Area3D var safety_zone: Area3D
@ -30,21 +31,19 @@ func _on_floor_started(delay: float, new_speed: float) -> void:
velocity = Vector3.ZERO velocity = Vector3.ZERO
stun_remaining = 0.0 stun_remaining = 0.0
speed = new_speed speed = new_speed
_delay_remaining = delay
robot_ready = false
func _physics_process(delta): func _physics_process(delta):
stalking_check()
if robot_win:
return
if not robot_ready: stalking_check()
if _delay_remaining > 0.0:
_delay_remaining -= delta if robot_win:
if _delay_remaining <= 0.0: velocity = Vector3(0, 0, -speed)
robot_ready = true move_and_slide()
if not _game_lost_emitted:
_walk_in_remaining -= delta
if _walk_in_remaining <= 0.0:
_game_lost_emitted = true
EventBus.game_lost.emit("ROBOT GOT IN")
return return
if stun_remaining > 0.0: if stun_remaining > 0.0:
@ -59,14 +58,12 @@ func _physics_process(delta):
func _on_area_3d_area_entered(area: Area3D) -> void: func _on_area_3d_area_entered(area: Area3D) -> void:
var safety = safety_zone var safety = safety_zone
if area == safety and doors_open: if area == safety and doors_open and not robot_win:
robot_win = true robot_win = true
EventBus.game_lost.emit(Strings.LOSS_ROBOT) _walk_in_remaining = WALK_IN_DURATION
func stalking_check(): func stalking_check():
if safety_zone == null:
return
var robot_position = self.global_transform.origin var robot_position = self.global_transform.origin
var elevator = safety_zone.global_transform.origin var elevator = safety_zone.global_transform.origin
var distance = robot_position.distance_to(elevator) var distance = robot_position.distance_to(elevator)

View file

@ -1 +1,26 @@
extends Control extends Control
func _ready():
if EventBus.debug_starting_floor > 0:
call_deferred("_start")
return
get_tree().paused = true
func _unhandled_input(event):
if event is InputEventKey and event.pressed and not event.echo:
if event.keycode == KEY_SPACE or event.keycode == KEY_ENTER:
get_viewport().set_input_as_handled()
_start()
elif event.keycode >= KEY_1 and event.keycode <= KEY_9:
EventBus.debug_starting_floor = event.keycode - KEY_0
get_viewport().set_input_as_handled()
_start()
elif event.keycode == KEY_0:
EventBus.debug_starting_floor = EventBus.STARTING_FLOOR
get_viewport().set_input_as_handled()
_start()
func _start():
get_tree().paused = false
EventBus.game_started.emit()
get_parent().queue_free()

View file

@ -12,7 +12,7 @@ anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
mouse_filter = 2 mouse_filter = 2
color = Color(0.05, 0.18, 0.05, 1) color = Color(0.102, 0.251, 0.278, 1)
[node name="Center" type="CenterContainer" parent="." unique_id=9544562] [node name="Center" type="CenterContainer" parent="." unique_id=9544562]
anchors_preset = 15 anchors_preset = 15
@ -35,7 +35,7 @@ theme_override_constants/separation = 24
[node name="Title" type="Label" parent="Center/Card/Margin/Column" unique_id=358683873] [node name="Title" type="Label" parent="Center/Card/Margin/Column" unique_id=358683873]
layout_mode = 2 layout_mode = 2
theme_override_colors/font_color = Color(0.2, 1, 0.2, 1) theme_override_colors/font_color = Color(0.553, 0.91, 1, 1)
theme_override_font_sizes/font_size = 48 theme_override_font_sizes/font_size = 48
text = "AGENTIC INCIDENT text = "AGENTIC INCIDENT
(A.I.)" (A.I.)"
@ -43,7 +43,7 @@ horizontal_alignment = 1
[node name="Prompt" type="Label" parent="Center/Card/Margin/Column" unique_id=366312976] [node name="Prompt" type="Label" parent="Center/Card/Margin/Column" unique_id=366312976]
layout_mode = 2 layout_mode = 2
theme_override_colors/font_color = Color(0.5, 1, 0.5, 1) theme_override_colors/font_color = Color(0.659, 1, 0.8, 1)
theme_override_font_sizes/font_size = 28 theme_override_font_sizes/font_size = 28
text = "PRESS SPACE TO START" text = "PRESS SPACE TO START"
horizontal_alignment = 1 horizontal_alignment = 1