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
42
WorldMapContent.gd
Normal file
42
WorldMapContent.gd
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
extends Node2D
|
||||
|
||||
const WORLD_TO_LOCAL: float = 0.04
|
||||
|
||||
@onready var tracker: Node2D = get_node("../../../ExplorationTracker")
|
||||
@onready var fleet: Node2D = get_node("../../../Fleet")
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if is_visible_in_tree():
|
||||
queue_redraw()
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
var chunk_size_local: float = WorldGen.CHUNK_SIZE * WORLD_TO_LOCAL
|
||||
|
||||
for chunk in tracker.get_explored_chunks():
|
||||
var origin_local: Vector2 = WorldGen.chunk_origin(chunk) * WORLD_TO_LOCAL
|
||||
var biome: int = WorldGen.biome_at_chunk(chunk)
|
||||
var color: Color = WorldGen.biome_color(biome)
|
||||
var rect: Rect2 = Rect2(origin_local, Vector2(chunk_size_local, chunk_size_local))
|
||||
draw_rect(rect, color, true)
|
||||
draw_rect(rect, Color(0.0, 0.0, 0.0, 0.4), false, 1.5)
|
||||
|
||||
if WorldGen.has_planet_at_chunk(chunk):
|
||||
# Same deterministic per-chunk data PlanetField spawns the
|
||||
# actual Planet from - the marker stays put on the map even
|
||||
# for a chunk whose Planet node isn't currently loaded (out of
|
||||
# spawn_radius_chunks of the fleet).
|
||||
var data: Dictionary = WorldGen.planet_data_at_chunk(chunk)
|
||||
var planet_local: Vector2 = origin_local + data.local_pos * WORLD_TO_LOCAL
|
||||
draw_circle(planet_local, 5.0, Color(0.7, 0.65, 0.55))
|
||||
draw_arc(planet_local, 5.0, 0.0, TAU, 16, Color(1.0, 1.0, 1.0, 0.9), 1.0, true)
|
||||
|
||||
var fleet_local: Vector2 = fleet.get_centroid() * WORLD_TO_LOCAL
|
||||
var marker_points: PackedVector2Array = PackedVector2Array([
|
||||
fleet_local + Vector2(0, -10),
|
||||
fleet_local + Vector2(7, 8),
|
||||
fleet_local + Vector2(-7, 8),
|
||||
])
|
||||
draw_colored_polygon(marker_points, Color(0.3, 0.9, 1.0))
|
||||
draw_polyline(PackedVector2Array([marker_points[0], marker_points[1], marker_points[2], marker_points[0]]), Color(1, 1, 1), 1.5, true)
|
||||
Loading…
Reference in a new issue