feat: cel-shaded look & feel overhaul — real audio, comic UI, themed VFX
Audio (all CC0 — Kenney packs + OpenGameArt, see assets/sounds/SOURCES.md): - Replace every procedural synth WAV with forged sounds (ffmpeg pitch/layer mixes): distinct fire sounds per weapon with 2-3 variations, explosions, footsteps x5, land/jump/dash/vault, knife swing, hit/kill confirms, bullet impacts, reload, flight loops, UI hover/click/confirm/error, match jingles, menu music - AudioManager.stream_for(): AudioStreamRandomizer per sound id — every weapon now gets variation + pitch randomization on each shot - Explosions and bullet impacts play positional audio; landing has its own sound instead of a pitched footstep; ambient wind bed on every map Visuals: - ExplosionVFX: shared cel-shaded burst (white-hot stepped core, ink shockwave ring, star spikes, flat smoke puffs) replaces the orange sphere in both local and remote-replay paths - Comic star muzzle flashes on all weapons; unified cel tracer bolts with ink outlines across hitscan/shotgun/remote paths - Impact decals: hard-stepped ink-splat gradients instead of soft airbrush - Toon shading on first-person view models + arms, third-person weapons, and the procedural humanoid fallback (no hull outlines on FBX weapons — their hard normals tear the inverted hull) - Fix: giant soft "blob" highlight on floors — toon rim/specular disabled on level-geometry materials (pre-existing artifact since the cel commit) - Fix: own third-person weapon rendered into the first-person camera (shadows-only now covers first_person_mode) UI: - UITheme: comic theme on the root window — Bangers display font (OFL), paper panels with thick ink borders + hard drop shadows, papaya accent, themed buttons/inputs/popups; hover/click sounds on all menu buttons - Main menu: tilted comic wordmark, sunset toon diorama, looping menu music - Match HUD: themed scoreboard/killfeed/kill counter Viewports: - 4x MSAA project-wide + viewmodel/diorama viewports (crisp ink lines) - Viewmodel camera near plane 0.01; third-person camera FOV syncs settings - debug/visual_capture.gd: dev tool to screenshot menu + level for review Verified: 11/11 movement tests, spawn smoke test 0 failures, before/after screenshot comparison of menu and level. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5
parent
1358183f98
commit
6c8b0ddd28
+38
-19
@@ -9,7 +9,23 @@ var _host_lobby_players_list: ItemList
|
||||
|
||||
func _ready() -> void:
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
|
||||
|
||||
# Comic/cel theme for every Control in the game (root window inherits down)
|
||||
UITheme.apply_global(get_tree())
|
||||
|
||||
# Menu music (scene-owned: stops automatically when a level loads)
|
||||
var music_path := "res://assets/sounds/music_menu.wav"
|
||||
if ResourceLoader.exists(music_path):
|
||||
var music := AudioStreamPlayer.new()
|
||||
music.stream = load(music_path)
|
||||
if music.stream is AudioStreamWAV:
|
||||
music.stream.loop_mode = AudioStreamWAV.LOOP_FORWARD
|
||||
music.stream.loop_end = music.stream.data.size() / 4 # 16-bit stereo frames
|
||||
music.bus = "Music"
|
||||
music.volume_db = -8.0
|
||||
music.autoplay = true
|
||||
add_child(music)
|
||||
|
||||
var nm = get_node_or_null("/root/NetworkManager")
|
||||
if nm:
|
||||
nm.connection_succeeded.connect(_on_connection_succeeded)
|
||||
@@ -25,6 +41,7 @@ func _ready() -> void:
|
||||
|
||||
var viewport = SubViewport.new()
|
||||
viewport.own_world_3d = true
|
||||
viewport.msaa_3d = Viewport.MSAA_4X
|
||||
right_panel.add_child(viewport)
|
||||
|
||||
_build_3d_diorama(viewport)
|
||||
@@ -40,13 +57,14 @@ func _ready() -> void:
|
||||
_ui_vbox.set_anchor_and_offset(SIDE_BOTTOM, 1.0, -50)
|
||||
add_child(_ui_vbox)
|
||||
|
||||
# Title
|
||||
# Title — big comic wordmark with a slight kinetic tilt
|
||||
var title = Label.new()
|
||||
title.text = "Papaya Shooter"
|
||||
title.add_theme_font_size_override("font_size", 72)
|
||||
title.add_theme_color_override("font_color", Color(1, 0.6, 0.2)) # Papaya orange
|
||||
title.add_theme_color_override("font_outline_color", Color(0, 0, 0))
|
||||
title.add_theme_constant_override("outline_size", 12)
|
||||
title.text = "PAPAYA SHOOTER"
|
||||
title.add_theme_font_size_override("font_size", 92)
|
||||
title.add_theme_color_override("font_color", UITheme.PAPAYA)
|
||||
title.add_theme_color_override("font_outline_color", UITheme.INK)
|
||||
title.add_theme_constant_override("outline_size", 16)
|
||||
title.rotation_degrees = -2.5
|
||||
_ui_vbox.add_child(title)
|
||||
|
||||
# Spacer
|
||||
@@ -269,6 +287,9 @@ func _ready() -> void:
|
||||
_host_lobby_players_list.add_theme_font_size_override("font_size", 24)
|
||||
hl_right.add_child(_host_lobby_players_list)
|
||||
|
||||
# Hover/click sounds on every menu button
|
||||
UITheme.wire_sounds(self)
|
||||
|
||||
func _load_maps_modularly(target_hbox: Container, is_multiplayer: bool, card_size: Vector2) -> void:
|
||||
var maps_dir = "res://scenes/maps/"
|
||||
var dir = DirAccess.open(maps_dir)
|
||||
@@ -492,13 +513,9 @@ func _build_3d_diorama(viewport: SubViewport) -> void:
|
||||
var world = Node3D.new()
|
||||
viewport.add_child(world)
|
||||
|
||||
# Lighting and Env
|
||||
# Lighting and Env — same stylized sunset sky as in-game for continuity
|
||||
var env = WorldEnvironment.new()
|
||||
var environment = Environment.new()
|
||||
environment.background_mode = Environment.BG_COLOR
|
||||
environment.background_color = Color(0.1, 0.15, 0.2) # Dark stylish background
|
||||
environment.tonemap_mode = Environment.TONE_MAPPER_ACES
|
||||
env.environment = environment
|
||||
env.environment = LevelEnvironment.make_environment("sunset")
|
||||
world.add_child(env)
|
||||
|
||||
var sun = DirectionalLight3D.new()
|
||||
@@ -514,22 +531,21 @@ func _build_3d_diorama(viewport: SubViewport) -> void:
|
||||
fill.light_energy = 0.5
|
||||
world.add_child(fill)
|
||||
|
||||
# Floor
|
||||
# Floor — toon world-grid like the levels
|
||||
var floor_mesh = MeshInstance3D.new()
|
||||
floor_mesh.mesh = PlaneMesh.new()
|
||||
floor_mesh.mesh.size = Vector2(20, 20)
|
||||
var floor_mat = StandardMaterial3D.new()
|
||||
floor_mat.albedo_color = Color(0.2, 0.2, 0.2)
|
||||
floor_mesh.mesh.surface_set_material(0, floor_mat)
|
||||
floor_mesh.mesh.surface_set_material(0, LevelMaterials.tinted(Color(0.32, 0.3, 0.38)))
|
||||
world.add_child(floor_mesh)
|
||||
|
||||
|
||||
# Player Model (Sliding Pose)
|
||||
var player_model = Node3D.new()
|
||||
player_model.position = Vector3(0, 0.5, 0) # Lowered for slide
|
||||
world.add_child(player_model)
|
||||
|
||||
|
||||
var body_mat = StandardMaterial3D.new()
|
||||
body_mat.albedo_color = Color(0.3, 0.6, 0.9)
|
||||
# Toonified below via apply_toon_recursive once the model is assembled
|
||||
|
||||
# Torso (Capsule tilted back)
|
||||
var torso = MeshInstance3D.new()
|
||||
@@ -576,6 +592,9 @@ func _build_3d_diorama(viewport: SubViewport) -> void:
|
||||
if shotgun.has_method("set_process_input"):
|
||||
shotgun.set_process_input(false)
|
||||
|
||||
# Cel-shade the diorama (no hull outlines — the FBX shotgun tears them)
|
||||
LevelMaterials.apply_toon_recursive(player_model, 0.0)
|
||||
|
||||
# Camera
|
||||
var camera = Camera3D.new()
|
||||
world.add_child(camera)
|
||||
|
||||
+7
-6
@@ -16,7 +16,10 @@ var _scoreboard_grid: GridContainer
|
||||
|
||||
func _ready() -> void:
|
||||
_nm = get_node_or_null("/root/NetworkManager")
|
||||
|
||||
# Ensure the comic theme is active even when a level is loaded directly
|
||||
# (tests, debug runs) without passing through the main menu.
|
||||
UITheme.apply_global(get_tree())
|
||||
|
||||
# Top HUD
|
||||
var top_hbox = HBoxContainer.new()
|
||||
top_hbox.set_anchors_preset(Control.PRESET_TOP_WIDE)
|
||||
@@ -37,8 +40,8 @@ func _ready() -> void:
|
||||
_local_kills_label = Label.new()
|
||||
_local_kills_label.text = "0 Kills"
|
||||
_local_kills_label.add_theme_font_size_override("font_size", 64)
|
||||
_local_kills_label.add_theme_color_override("font_color", Color(1, 0.8, 0.2))
|
||||
_local_kills_label.add_theme_color_override("font_outline_color", Color.BLACK)
|
||||
_local_kills_label.add_theme_color_override("font_color", UITheme.PAPAYA)
|
||||
_local_kills_label.add_theme_color_override("font_outline_color", UITheme.INK)
|
||||
_local_kills_label.add_theme_constant_override("outline_size", 12)
|
||||
top_hbox.add_child(_local_kills_label)
|
||||
|
||||
@@ -68,9 +71,7 @@ func _ready() -> void:
|
||||
|
||||
_scoreboard_panel = PanelContainer.new()
|
||||
_scoreboard_panel.custom_minimum_size = Vector2(800, 600)
|
||||
var sb_style = StyleBoxFlat.new()
|
||||
sb_style.bg_color = Color(0, 0, 0, 0.8)
|
||||
_scoreboard_panel.add_theme_stylebox_override("panel", sb_style)
|
||||
# Styled by the shared UITheme PanelContainer stylebox (ink-border card)
|
||||
_scoreboard_panel.hide()
|
||||
center_container.add_child(_scoreboard_panel)
|
||||
|
||||
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
extends Object
|
||||
class_name UITheme
|
||||
|
||||
## Shared comic/cel UI theme: Bangers display font, paper panels with thick
|
||||
## ink borders and hard drop shadows, papaya accent. Built once, applied to
|
||||
## the root Window so every Control in the game inherits it.
|
||||
|
||||
const FONT_PATH := "res://assets/ui/fonts/Bangers-Regular.ttf"
|
||||
|
||||
const INK := Color(0.09, 0.08, 0.12)
|
||||
const PAPER := Color(0.98, 0.96, 0.9)
|
||||
const PAPER_DIM := Color(0.92, 0.9, 0.84)
|
||||
const PAPAYA := Color(1.0, 0.55, 0.15)
|
||||
const PAPAYA_HOT := Color(1.0, 0.68, 0.25)
|
||||
const TEAL := Color(0.16, 0.72, 0.68)
|
||||
|
||||
static var _theme: Theme = null
|
||||
|
||||
|
||||
## Comic panel stylebox: flat fill, thick ink border, hard offset shadow.
|
||||
static func box(bg: Color, border: Color = INK, radius: int = 10,
|
||||
border_w: int = 3, shadow: bool = true) -> StyleBoxFlat:
|
||||
var sb := StyleBoxFlat.new()
|
||||
sb.bg_color = bg
|
||||
sb.border_color = border
|
||||
sb.set_border_width_all(border_w)
|
||||
sb.set_corner_radius_all(radius)
|
||||
sb.content_margin_left = 16
|
||||
sb.content_margin_right = 16
|
||||
sb.content_margin_top = 8
|
||||
sb.content_margin_bottom = 8
|
||||
if shadow:
|
||||
sb.shadow_color = Color(INK.r, INK.g, INK.b, 0.55)
|
||||
sb.shadow_size = 0
|
||||
sb.shadow_offset = Vector2(4, 4)
|
||||
sb.shadow_size = 2
|
||||
return sb
|
||||
|
||||
|
||||
static func build() -> Theme:
|
||||
if _theme:
|
||||
return _theme
|
||||
var t := Theme.new()
|
||||
var font: Font = load(FONT_PATH) if ResourceLoader.exists(FONT_PATH) else null
|
||||
if font:
|
||||
t.default_font = font
|
||||
t.default_font_size = 26
|
||||
|
||||
# ── Buttons: paper card, papaya on hover, squash on press ────────────
|
||||
t.set_stylebox("normal", "Button", box(PAPER))
|
||||
t.set_stylebox("hover", "Button", box(PAPAYA_HOT))
|
||||
t.set_stylebox("pressed", "Button", box(PAPAYA, INK, 10, 3, false))
|
||||
t.set_stylebox("focus", "Button", box(PAPER, TEAL))
|
||||
t.set_stylebox("disabled", "Button", box(PAPER_DIM, Color(0.4, 0.4, 0.45)))
|
||||
t.set_color("font_color", "Button", INK)
|
||||
t.set_color("font_hover_color", "Button", INK)
|
||||
t.set_color("font_pressed_color", "Button", PAPER)
|
||||
t.set_color("font_focus_color", "Button", INK)
|
||||
t.set_color("font_disabled_color", "Button", Color(0.45, 0.45, 0.5))
|
||||
|
||||
# OptionButton / CheckBox get the same treatment explicitly (Godot theme
|
||||
# types don't inherit styling from Button)
|
||||
for cls in ["OptionButton", "MenuButton", "CheckBox", "CheckButton"]:
|
||||
t.set_stylebox("normal", cls, box(PAPER))
|
||||
t.set_stylebox("hover", cls, box(PAPAYA_HOT))
|
||||
t.set_stylebox("pressed", cls, box(PAPAYA, INK, 10, 3, false))
|
||||
t.set_stylebox("focus", cls, box(PAPER, TEAL))
|
||||
t.set_stylebox("disabled", cls, box(PAPER_DIM, Color(0.4, 0.4, 0.45)))
|
||||
t.set_color("font_color", cls, INK)
|
||||
t.set_color("font_hover_color", cls, INK)
|
||||
t.set_color("font_pressed_color", cls, PAPER)
|
||||
t.set_color("font_focus_color", cls, INK)
|
||||
t.set_color("font_disabled_color", cls, Color(0.45, 0.45, 0.5))
|
||||
|
||||
# ── Labels: ink outline everywhere for that inked-cel readability ────
|
||||
t.set_color("font_outline_color", "Label", INK)
|
||||
t.set_constant("outline_size", "Label", 8)
|
||||
t.set_color("font_color", "Label", PAPER)
|
||||
|
||||
# RichTextLabel (killfeed)
|
||||
t.set_color("default_color", "RichTextLabel", PAPER)
|
||||
t.set_color("font_outline_color", "RichTextLabel", INK)
|
||||
t.set_constant("outline_size", "RichTextLabel", 6)
|
||||
|
||||
# ── Inputs ───────────────────────────────────────────────────────────
|
||||
t.set_stylebox("normal", "LineEdit", box(PAPER, INK, 8, 3, false))
|
||||
t.set_stylebox("focus", "LineEdit", box(PAPER, TEAL, 8, 3, false))
|
||||
t.set_color("font_color", "LineEdit", INK)
|
||||
t.set_color("caret_color", "LineEdit", INK)
|
||||
|
||||
# ── Panels / lists ───────────────────────────────────────────────────
|
||||
t.set_stylebox("panel", "PanelContainer", box(Color(0.13, 0.12, 0.18, 0.92), INK, 14, 4))
|
||||
t.set_stylebox("panel", "ItemList", box(Color(0.13, 0.12, 0.18, 0.92), INK, 10, 3, false))
|
||||
t.set_color("font_color", "ItemList", PAPER)
|
||||
|
||||
# ── Popup menus (OptionButton dropdowns) ─────────────────────────────
|
||||
t.set_stylebox("panel", "PopupMenu", box(PAPER, INK, 8, 3, false))
|
||||
t.set_color("font_color", "PopupMenu", INK)
|
||||
t.set_color("font_hover_color", "PopupMenu", PAPAYA)
|
||||
|
||||
_theme = t
|
||||
return t
|
||||
|
||||
|
||||
## Apply the theme to the whole root window (inherited by every Control in
|
||||
## every scene from then on). Idempotent.
|
||||
static func apply_global(tree: SceneTree) -> void:
|
||||
if tree and tree.root and tree.root.theme != build():
|
||||
tree.root.theme = build()
|
||||
|
||||
|
||||
## Attach hover/click UI sounds to every BaseButton under `root` (recursive).
|
||||
static func wire_sounds(root: Node) -> void:
|
||||
var am = root.get_tree().root.get_node_or_null("AudioManager")
|
||||
if am == null:
|
||||
return
|
||||
for btn in root.find_children("*", "BaseButton", true, false):
|
||||
if btn.has_meta("ui_sfx_wired"):
|
||||
continue
|
||||
btn.set_meta("ui_sfx_wired", true)
|
||||
btn.mouse_entered.connect(func(): am.play_ui("ui_hover"))
|
||||
btn.pressed.connect(func(): am.play_ui("ui_click"))
|
||||
@@ -0,0 +1 @@
|
||||
uid://doqqa8s8bal5u
|
||||
Reference in New Issue
Block a user