diff --git a/scripts/kinetic_projectile.gd b/scripts/kinetic_projectile.gd index e425f2e..97274de 100644 --- a/scripts/kinetic_projectile.gd +++ b/scripts/kinetic_projectile.gd @@ -9,16 +9,15 @@ extends Area2D @export var knockback := 220.0 @export var lifetime := 0.8 -const SPRITE := preload("res://assets/sprites_ph/slug_ph.png") - var direction := Vector2.RIGHT func _ready() -> void: add_to_group("projectiles") rotation = direction.angle() + # Runtime load, not preload — resilient to a stale import cache. var spr := Sprite2D.new() - spr.texture = SPRITE + spr.texture = load("res://assets/sprites_ph/slug_ph.png") add_child(spr) body_entered.connect(_on_body_entered) diff --git a/scripts/mech.gd b/scripts/mech.gd index be1bb09..ade243a 100644 --- a/scripts/mech.gd +++ b/scripts/mech.gd @@ -16,14 +16,14 @@ var hull: float var _dash := Vector2.ZERO -const SPRITE := preload("res://assets/sprites_ph/m03_ph.png") - - func _ready() -> void: add_to_group("mech") hull = hull_max + # Runtime load (not preload): a stale/incomplete import cache must + # degrade to an invisible sprite, never a script-compile failure + # that would kill movement too. var spr := Sprite2D.new() - spr.texture = SPRITE + spr.texture = load("res://assets/sprites_ph/m03_ph.png") add_child(spr) diff --git a/scripts/salvage.gd b/scripts/salvage.gd index 2f28a76..9e23168 100644 --- a/scripts/salvage.gd +++ b/scripts/salvage.gd @@ -4,8 +4,6 @@ extends Area2D ## levels). Drifts to the mech inside the magnet radius, collected on ## contact, fades out if ignored. Constructed in code, no scene. -const SPRITE := preload("res://assets/sprites_ph/scrap_ph.png") - var value := 1 var magnet_radius := 70.0 var drift_speed := 150.0 @@ -25,8 +23,9 @@ func _ready() -> void: sh.radius = 6.0 cs.shape = sh add_child(cs) + # Runtime load, not preload — resilient to a stale import cache. _sprite = Sprite2D.new() - _sprite.texture = SPRITE + _sprite.texture = load("res://assets/sprites_ph/scrap_ph.png") add_child(_sprite) body_entered.connect(_on_body_entered)