Initial commit: SpaceshipTest, a top-down space RTS in Godot 4.7.1
A fleet of neon-outlined ships explores a procedurally generated, seeded infinite world: tap/joystick steering, pinch zoom, formation pivoting, planet landings, an ore economy with extractors and haulers, and player built structures (mothership, ship crafter, command centre). All art is hand-drawn with draw_* calls rather than textures, and the backgrounds are camera-relative shaders so they stay precise at large world coordinates. Includes a 35-test headless suite (tests/run_tests.sh) plus screenshot tooling that renders real frames through Xvfb and Mesa softpipe, since --headless has no GPU. Excluded from version control: .godot/ (import cache, and it holds export credentials), builds/, android/build/ and packaged APKs - all regenerable, and ~325 MB combined. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
commit
85814ce88c
192 changed files with 9602 additions and 0 deletions
58
ExplosionVFXBase.gd
Normal file
58
ExplosionVFXBase.gd
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
class_name ExplosionVFXBase
|
||||
extends Node2D
|
||||
|
||||
# Shared particle motion/fade/lifetime logic for all explosion VFX types.
|
||||
# Subclasses fix their own visual style and color as facts about
|
||||
# themselves (see LightBurstVFX/AsteroidExplosionVFX), not as parameters
|
||||
# passed in by whatever destroyed the object - so "ships always explode
|
||||
# blue" is guaranteed by the class hierarchy, not by remembering to pass
|
||||
# the right Color() at each call site.
|
||||
|
||||
@export var particle_count: int = 12
|
||||
@export var lifetime: float = 0.5
|
||||
@export var min_speed: float = 60.0
|
||||
@export var max_speed: float = 220.0
|
||||
|
||||
var age: float = 0.0
|
||||
var particles: Array = []
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
randomize()
|
||||
for i in range(particle_count):
|
||||
var angle: float = randf() * TAU
|
||||
var speed: float = randf_range(min_speed, max_speed)
|
||||
particles.append({
|
||||
"pos": Vector2.ZERO,
|
||||
"vel": Vector2(cos(angle), sin(angle)) * speed,
|
||||
"rot": randf() * TAU,
|
||||
"rot_speed": randf_range(-6.0, 6.0),
|
||||
"size": _random_particle_size(),
|
||||
})
|
||||
queue_redraw()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
age += delta
|
||||
if age >= lifetime:
|
||||
queue_free()
|
||||
return
|
||||
for p in particles:
|
||||
p["pos"] += p["vel"] * delta
|
||||
p["vel"] *= 0.9
|
||||
p["rot"] += p["rot_speed"] * delta
|
||||
queue_redraw()
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
var alpha: float = clamp(1.0 - (age / lifetime), 0.0, 1.0)
|
||||
for p in particles:
|
||||
_draw_particle(p, alpha)
|
||||
|
||||
|
||||
func _random_particle_size() -> float:
|
||||
return randf_range(10.0, 20.0)
|
||||
|
||||
|
||||
func _draw_particle(_p: Dictionary, _alpha: float) -> void:
|
||||
pass
|
||||
Loading…
Reference in a new issue