Asteroids can be shot apart for the ore inside them
Asteroids were pure hazard: the only thing one could ever do was cost you a ship. They now take damage like anything else and break open, dropping ore the fleet can fly over and collect - the one resource reachable in open space without conquering anything, and something for the new fire stick to do out there. Two ways to destroy one, deliberately not equivalent. Shot apart yields the ore; flown into does not - the rock shatters against a hull rather than being mined, and a ship or a shield charge has just been spent on it. Without that split a shield vessel could farm asteroids by ramming them. Asteroid.take_damage() matches Enemy's contract exactly, so every weapon that already knew how to hurt an enemy hurts an asteroid through the same branch rather than a second special case: bolts, the laser sweep, and the gas bomb's blast all pick both groups up together. Dropped ore carries the asteroid's own drift, so it reads as debris rather than as a spawned pickup, and it expires after a minute. Rock grew an optional lifetime for that, defaulting to 0 (never) so hand-placed surface rocks are unchanged - a planet surface is bounded and authored, open space is not, and a field shot up and abandoned would otherwise leak nodes for the session. Rock's header note that asteroids and rocks are never on screen together is no longer true and now says so; the hexagon-versus-lump shape language matters more now that they sit side by side, not less. Five weapon tests silenced the asteroid field but never cleared what it had already placed. That was harmless while asteroids were untouchable and is not any more - two of them assert exact hit counts, and a drifting rock in the beam would have made those fail intermittently. Suite 111/111. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
0fb8f9300b
commit
4cc9c417ca
11 changed files with 290 additions and 10 deletions
24
Rock.gd
24
Rock.gd
|
|
@ -4,11 +4,11 @@ extends Area2D
|
|||
# up by flying any ship over it; the fleet doesn't need to stop.
|
||||
#
|
||||
# Deliberately drawn as a PERFECT HEXAGON rather than the irregular lumpy
|
||||
# polygon Asteroid.gd uses. The two are never on screen
|
||||
# together (asteroids are space-only, rocks surface-only), so the player
|
||||
# can only tell "collect this" from "this hurts" by learned shape language:
|
||||
# irregular and jagged reads as a natural hazard, regular and faceted reads
|
||||
# as something valuable and meant to be picked up.
|
||||
# polygon Asteroid.gd uses. The two now DO appear together - shooting an
|
||||
# asteroid drops one of these right next to its neighbours - which makes the
|
||||
# shape language matter more than when they were kept apart by scene: jagged
|
||||
# and irregular reads as a natural hazard, regular and faceted reads as
|
||||
# something valuable and meant to be picked up.
|
||||
#
|
||||
# It also drifts toward a nearby ship (see _physics_process). Nothing
|
||||
# harmful moves helpfully toward you, so the pull doubles as a readability
|
||||
|
|
@ -16,6 +16,13 @@ extends Area2D
|
|||
|
||||
signal collected
|
||||
|
||||
# Seconds before an uncollected rock disappears. 0 means never, which is what
|
||||
# hand-placed surface rocks use - a planet surface is bounded and authored, so
|
||||
# nothing accumulates. Ore dropped by a shot asteroid sets a real lifetime,
|
||||
# because open space is unbounded and a field shot up and left behind would
|
||||
# otherwise leak nodes for the rest of the session.
|
||||
@export var lifetime: float = 0.0
|
||||
|
||||
@export var attract_radius: float = 220.0
|
||||
@export var attract_speed: float = 260.0
|
||||
@export var attract_accel: float = 420.0
|
||||
|
|
@ -24,6 +31,7 @@ var shape_points: PackedVector2Array = PackedVector2Array()
|
|||
var facet_points: PackedVector2Array = PackedVector2Array()
|
||||
var size_scale: float = 1.0
|
||||
var velocity: Vector2 = Vector2.ZERO
|
||||
var age: float = 0.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
|
|
@ -56,6 +64,12 @@ func build_shape(shape_seed: int) -> void:
|
|||
func _physics_process(delta: float) -> void:
|
||||
# Drift toward the closest ship inside attract_radius. No redraw here:
|
||||
# position is a transform property and the crystal's shape is fixed.
|
||||
if lifetime > 0.0:
|
||||
age += delta
|
||||
if age >= lifetime:
|
||||
queue_free()
|
||||
return
|
||||
|
||||
var target: Node2D = _nearest_ship()
|
||||
if target == null:
|
||||
velocity = velocity.move_toward(Vector2.ZERO, attract_accel * delta)
|
||||
|
|
|
|||
Loading…
Reference in a new issue