mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-13 22:22:03 +00:00
refactor(*): DRY up arena scenes, game modes, and HUD instruments
Arenas inherit from a new arena_base.tscn instead of restating ~40 shared lines each; only sky/ambient/glow/tint/decoration vary, exposed via new Arena exports since nested Environment properties aren't overridable through scene inheritance. Bot construction and score-keeping move onto GameMode, shared by match and spectate modes while preserving their differing GameSettings-override behavior and the HUD's score-row duck-typing. HUD instruments share a HudInstrument base for the smoothing-weight calc and angle-lerp helper. Also dedupes MAIN_MENU_SCENE_PATH into ScenePaths and documents why DIFFICULTIES tiers share one checkpoint.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class_name HudHeadingTape
|
||||
extends Control
|
||||
extends HudInstrument
|
||||
|
||||
# Aircraft-style heading tape: a strip of compass ticks slides under a fixed
|
||||
# centre marker, with cardinal letters so the player always knows which way
|
||||
@@ -11,7 +11,6 @@ const MARKER_COLOR := Color(1.0, 0.8, 0.2)
|
||||
|
||||
# Degrees of heading visible across the full tape width.
|
||||
const VISIBLE_RANGE := 90.0
|
||||
const SMOOTHING := 12.0
|
||||
|
||||
const CARDINALS := {0: "N", 45: "NE", 90: "E", 135: "SE", 180: "S", 225: "SW", 270: "W", 315: "NW"}
|
||||
|
||||
@@ -28,8 +27,8 @@ func set_heading(heading_deg: float) -> void:
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
var t := 1.0 - exp(-SMOOTHING * delta) # frame-rate independent
|
||||
_heading = fmod(HudAttitudeIndicator.lerp_angle_deg(_heading, _target_heading, t) + 360.0, 360.0)
|
||||
var t := _smoothing_weight(delta)
|
||||
_heading = fmod(lerp_angle_deg(_heading, _target_heading, t) + 360.0, 360.0)
|
||||
queue_redraw()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user