mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
refactor(team-colors): collapse disagreeing team palettes into one source of truth
ship.gd, HUDController.gd, and goal.gd each declared their own TEAM_COLORS, arena_boundary.gd/arena_deck.gdshader had a third pair, and HUD.tscn baked in a fourth (hardcoded "BLUE"/"ORANGE" labels) — nose, goal rim, end zone, and scoreboard all rendered different blues. New scripts/team_colors.gd (class_name TeamColors) is now the single source every one of those reads from, and team identity moves to purple/green.
This commit is contained in:
@@ -25,13 +25,6 @@ extends RigidBody3D
|
||||
@export var ceiling_pull_strength = 11.5 # Ceiling grav-plating strength; nets above gravity so a ship can hold a ceiling
|
||||
@export var ceiling_pull_range = 3.0 # Metres from the ceiling where pull begins
|
||||
|
||||
# Accent colours per team, applied to the nose and tail fin meshes so the
|
||||
# two sides are tellable apart at a glance.
|
||||
const TEAM_COLORS := {
|
||||
0: Color(0.25, 0.55, 1.0),
|
||||
1: Color(1.0, 0.5, 0.15),
|
||||
}
|
||||
|
||||
# Non-tinted hull meshes, runtime-merged into one ArrayMesh by
|
||||
# _build_merged_hull() (Nose/TailFin stay separate MeshInstance3Ds since
|
||||
# _apply_team_color() retints them per-team and must keep addressing them by
|
||||
@@ -73,7 +66,7 @@ static var _team_materials: Dictionary = {} # team:int -> StandardMaterial3D
|
||||
static func _get_team_material(team: int) -> StandardMaterial3D:
|
||||
if _team_materials.has(team):
|
||||
return _team_materials[team]
|
||||
var color: Color = TEAM_COLORS.get(team, TEAM_COLORS[0])
|
||||
var color: Color = TeamColors.TEAM_COLORS.get(team, TeamColors.TEAM_COLORS[0])
|
||||
var accent := StandardMaterial3D.new()
|
||||
accent.albedo_color = color
|
||||
accent.metallic = 0.3
|
||||
|
||||
Reference in New Issue
Block a user