#84: move 215 root files into a folder hierarchy

Everything lived in one flat directory, so a diff gave no clue what area it
touched and finding the file you wanted meant knowing its exact name. Twelve
folders now, grouped by what a thing IS rather than what type it is - a
vessel's definition, its component scenes and its upgrade resources sit
together, because that is the set you read when you change one of them.

  buildings  core  controllers  enemies  logistics  planets
  resources  shaders  surface  ui  vessels  vfx  world

332 files moved and every res:// reference rewritten - 306 files touched,
including the autoload and main-scene paths in project.godot. Nothing renamed:
this is purely where files sit, so the diff is a pile of pure moves and no
behaviour is buried in it. ui_theme.tres, icon.svg and web_shell.html stay at
the root, where Godot and the export preset expect them.

Verified three ways, because a suite alone would not have caught all of it:
the full 117 pass, the web export builds clean, and the game renders.

The export is why that matters. The FIRST export after the move failed with
"Attempt to open script 'res://GameState.gd'" - the old path - while
project.godot on disk plainly said res://core/GameState.gd. That is this
project's documented Android FUSE mtime trap: Godot served a cached copy of a
file whose content had changed. A `touch` fixed it. Nothing in the test suite
would have found that, because the suite runs from a copy on a native
filesystem - the one place the bug cannot happen.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Loïc Wisniewski 2026-08-21 19:44:14 +02:00
commit 2f161621c3
495 changed files with 571 additions and 567 deletions

View file

@ -1,22 +0,0 @@
class_name BuildingDefinitions
extends RefCounted
const ORDER: PackedStringArray = ["mothership", "ship_crafter", "command_center", "extractor", "transport_hub", "ship_lab", "gas_burner"]
const DEFINITIONS: Dictionary = {
"mothership": preload("res://MothershipBuildingDefinition.tres"),
"ship_crafter": preload("res://CrafterBuildingDefinition.tres"),
"command_center": preload("res://CommandBuildingDefinition.tres"),
"extractor": preload("res://ExtractorBuildingDefinition.tres"),
"transport_hub": preload("res://TransportHubBuildingDefinition.tres"),
"ship_lab": preload("res://ShipLabBuildingDefinition.tres"),
"gas_burner": preload("res://GasBurnerBuildingDefinition.tres"),
}
static func get_definition(definition_id: String) -> Resource:
return DEFINITIONS.get(definition_id)
static func all() -> Array:
var result: Array = []
for definition_id in ORDER:
result.append(DEFINITIONS[definition_id])
return result

View file

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="PlanetSetup" format=3] [gd_resource type="Resource" script_class="PlanetSetup" format=3]
[ext_resource type="Script" path="res://PlanetSetupSpawn.gd" id="1"] [ext_resource type="Script" path="res://surface/PlanetSetupSpawn.gd" id="1"]
[ext_resource type="Script" path="res://PlanetSetup.gd" id="2"] [ext_resource type="Script" path="res://surface/PlanetSetup.gd" id="2"]
[sub_resource type="Resource" id="Resource_ta1"] [sub_resource type="Resource" id="Resource_ta1"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="PlanetSetup" format=3] [gd_resource type="Resource" script_class="PlanetSetup" format=3]
[ext_resource type="Script" path="res://PlanetSetup.gd" id="1"] [ext_resource type="Script" path="res://surface/PlanetSetup.gd" id="1"]
[ext_resource type="Script" path="res://PlanetSetupSpawn.gd" id="2"] [ext_resource type="Script" path="res://surface/PlanetSetupSpawn.gd" id="2"]
[sub_resource type="Resource" id="Resource_che8f"] [sub_resource type="Resource" id="Resource_che8f"]
script = ExtResource("2") script = ExtResource("2")

View file

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="PlanetSetup" format=3] [gd_resource type="Resource" script_class="PlanetSetup" format=3]
[ext_resource type="Script" path="res://PlanetSetupSpawn.gd" id="1_p34gm"] [ext_resource type="Script" path="res://surface/PlanetSetupSpawn.gd" id="1_p34gm"]
[ext_resource type="Script" path="res://PlanetSetup.gd" id="2_oxc3b"] [ext_resource type="Script" path="res://surface/PlanetSetup.gd" id="2_oxc3b"]
[sub_resource type="Resource" id="Resource_p34gm"] [sub_resource type="Resource" id="Resource_p34gm"]
script = ExtResource("1_p34gm") script = ExtResource("1_p34gm")

View file

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="PlanetSetup" format=3] [gd_resource type="Resource" script_class="PlanetSetup" format=3]
[ext_resource type="Script" path="res://PlanetSetup.gd" id="1"] [ext_resource type="Script" path="res://surface/PlanetSetup.gd" id="1"]
[ext_resource type="Script" path="res://PlanetSetupSpawn.gd" id="2"] [ext_resource type="Script" path="res://surface/PlanetSetupSpawn.gd" id="2"]
[sub_resource type="Resource" id="Resource_kkunv"] [sub_resource type="Resource" id="Resource_kkunv"]
script = ExtResource("2") script = ExtResource("2")

View file

@ -1,6 +1,6 @@
extends Node2D extends Node2D
const BUILDING_DEFINITIONS = preload("res://BuildingDefinitions.gd") const BUILDING_DEFINITIONS = preload("res://buildings/BuildingDefinitions.gd")
@export var definition_id: String = "mothership" @export var definition_id: String = "mothership"
@export var building_id: int = 0 @export var building_id: int = 0

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3] [gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://Building.gd" id="1"] [ext_resource type="Script" path="res://buildings/Building.gd" id="1"]
[node name="Building" type="Node2D"] [node name="Building" type="Node2D"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -0,0 +1,22 @@
class_name BuildingDefinitions
extends RefCounted
const ORDER: PackedStringArray = ["mothership", "ship_crafter", "command_center", "extractor", "transport_hub", "ship_lab", "gas_burner"]
const DEFINITIONS: Dictionary = {
"mothership": preload("res://buildings/MothershipBuildingDefinition.tres"),
"ship_crafter": preload("res://buildings/CrafterBuildingDefinition.tres"),
"command_center": preload("res://buildings/CommandBuildingDefinition.tres"),
"extractor": preload("res://buildings/ExtractorBuildingDefinition.tres"),
"transport_hub": preload("res://buildings/TransportHubBuildingDefinition.tres"),
"ship_lab": preload("res://buildings/ShipLabBuildingDefinition.tres"),
"gas_burner": preload("res://buildings/GasBurnerBuildingDefinition.tres"),
}
static func get_definition(definition_id: String) -> Resource:
return DEFINITIONS.get(definition_id)
static func all() -> Array:
var result: Array = []
for definition_id in ORDER:
result.append(DEFINITIONS[definition_id])
return result

View file

@ -9,7 +9,7 @@ extends Node2D
@onready var fleet: Node2D = get_node("../Fleet") @onready var fleet: Node2D = get_node("../Fleet")
var building_scene: PackedScene = preload("res://Building.tscn") var building_scene: PackedScene = preload("res://buildings/Building.tscn")
var spawned: Array = [] var spawned: Array = []
# Nothing happens here per frame any more. Arriving at the mothership used to # Nothing happens here per frame any more. Arriving at the mothership used to

View file

@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="BuildingDefinition" load_steps=3 format=3] [gd_resource type="Resource" script_class="BuildingDefinition" load_steps=3 format=3]
[ext_resource type="Script" path="res://BuildingDefinition.gd" id="1"] [ext_resource type="Script" path="res://buildings/BuildingDefinition.gd" id="1"]
[ext_resource type="PackedScene" path="res://CommandBuildingVisual.tscn" id="2"] [ext_resource type="PackedScene" path="res://buildings/CommandBuildingVisual.tscn" id="2"]
[resource] [resource]
script = ExtResource("1") script = ExtResource("1")
definition_id = "command_center" definition_id = "command_center"

View file

@ -1,4 +1,4 @@
extends "res://BuildingVisualBase.gd" extends "res://buildings/BuildingVisualBase.gd"
func _ready() -> void: func _ready() -> void:
set_process(false) set_process(false)

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3] [gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://CommandBuildingVisual.gd" id="1"] [ext_resource type="Script" path="res://buildings/CommandBuildingVisual.gd" id="1"]
[ext_resource type="Script" path="res://BuildingActionProvider.gd" id="2"] [ext_resource type="Script" path="res://buildings/BuildingActionProvider.gd" id="2"]
[node name="Visual" type="Node2D"] [node name="Visual" type="Node2D"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="BuildingDefinition" load_steps=3 format=3] [gd_resource type="Resource" script_class="BuildingDefinition" load_steps=3 format=3]
[ext_resource type="Script" path="res://BuildingDefinition.gd" id="1"] [ext_resource type="Script" path="res://buildings/BuildingDefinition.gd" id="1"]
[ext_resource type="PackedScene" path="res://CrafterBuildingVisual.tscn" id="2"] [ext_resource type="PackedScene" path="res://buildings/CrafterBuildingVisual.tscn" id="2"]
[resource] [resource]
script = ExtResource("1") script = ExtResource("1")
definition_id = "ship_crafter" definition_id = "ship_crafter"

View file

@ -1,4 +1,4 @@
extends "res://BuildingVisualBase.gd" extends "res://buildings/BuildingVisualBase.gd"
func _ready() -> void: func _ready() -> void:
for part in SHIP_PARTS: for part in SHIP_PARTS:

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3] [gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://CrafterBuildingVisual.gd" id="1"] [ext_resource type="Script" path="res://buildings/CrafterBuildingVisual.gd" id="1"]
[ext_resource type="Script" path="res://BuildingActionProvider.gd" id="2"] [ext_resource type="Script" path="res://buildings/BuildingActionProvider.gd" id="2"]
[node name="Visual" type="Node2D"] [node name="Visual" type="Node2D"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -1,5 +1,5 @@
[gd_resource type="Resource" script_class="BuildingDefinition" load_steps=2 format=3] [gd_resource type="Resource" script_class="BuildingDefinition" load_steps=2 format=3]
[ext_resource type="Script" path="res://BuildingDefinition.gd" id="1"] [ext_resource type="Script" path="res://buildings/BuildingDefinition.gd" id="1"]
[resource] [resource]
script = ExtResource("1") script = ExtResource("1")
definition_id = "extractor" definition_id = "extractor"

View file

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="BuildingDefinition" load_steps=4 format=3] [gd_resource type="Resource" script_class="BuildingDefinition" load_steps=4 format=3]
[ext_resource type="Script" path="res://BuildingDefinition.gd" id="1"] [ext_resource type="Script" path="res://buildings/BuildingDefinition.gd" id="1"]
[ext_resource type="PackedScene" path="res://GasBurnerBuildingVisual.tscn" id="2"] [ext_resource type="PackedScene" path="res://buildings/GasBurnerBuildingVisual.tscn" id="2"]
[ext_resource type="Script" path="res://BuildingLogisticsProfile.gd" id="3"] [ext_resource type="Script" path="res://buildings/BuildingLogisticsProfile.gd" id="3"]
[sub_resource type="Resource" id="Resource_logistics"] [sub_resource type="Resource" id="Resource_logistics"]
script = ExtResource("3") script = ExtResource("3")

View file

@ -1,4 +1,4 @@
extends "res://BuildingVisualBase.gd" extends "res://buildings/BuildingVisualBase.gd"
# Drawn once, not per frame - the burner has no animation. It does have two # Drawn once, not per frame - the burner has no animation. It does have two
# LOOKS though (#78): lit while it is converting, cold while the player has # LOOKS though (#78): lit while it is converting, cold while the player has

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3] [gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://GasBurnerBuildingVisual.gd" id="1"] [ext_resource type="Script" path="res://buildings/GasBurnerBuildingVisual.gd" id="1"]
[ext_resource type="Script" path="res://BuildingActionProvider.gd" id="2"] [ext_resource type="Script" path="res://buildings/BuildingActionProvider.gd" id="2"]
[node name="Visual" type="Node2D"] [node name="Visual" type="Node2D"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="BuildingDefinition" load_steps=3 format=3] [gd_resource type="Resource" script_class="BuildingDefinition" load_steps=3 format=3]
[ext_resource type="Script" path="res://BuildingDefinition.gd" id="1"] [ext_resource type="Script" path="res://buildings/BuildingDefinition.gd" id="1"]
[ext_resource type="PackedScene" path="res://MothershipBuildingVisual.tscn" id="2"] [ext_resource type="PackedScene" path="res://buildings/MothershipBuildingVisual.tscn" id="2"]
[resource] [resource]
script = ExtResource("1") script = ExtResource("1")
definition_id = "mothership" definition_id = "mothership"

View file

@ -1,4 +1,4 @@
extends "res://BuildingVisualBase.gd" extends "res://buildings/BuildingVisualBase.gd"
func _ready() -> void: func _ready() -> void:
_build_mothership_pieces() _build_mothership_pieces()

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3] [gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://MothershipBuildingVisual.gd" id="1"] [ext_resource type="Script" path="res://buildings/MothershipBuildingVisual.gd" id="1"]
[ext_resource type="Script" path="res://BuildingActionProvider.gd" id="2"] [ext_resource type="Script" path="res://buildings/BuildingActionProvider.gd" id="2"]
[node name="Visual" type="Node2D"] [node name="Visual" type="Node2D"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="BuildingDefinition" load_steps=3 format=3] [gd_resource type="Resource" script_class="BuildingDefinition" load_steps=3 format=3]
[ext_resource type="Script" path="res://BuildingDefinition.gd" id="1"] [ext_resource type="Script" path="res://buildings/BuildingDefinition.gd" id="1"]
[ext_resource type="PackedScene" path="res://ShipLabBuildingVisual.tscn" id="2"] [ext_resource type="PackedScene" path="res://buildings/ShipLabBuildingVisual.tscn" id="2"]
[resource] [resource]
script = ExtResource("1") script = ExtResource("1")
definition_id = "ship_lab" definition_id = "ship_lab"

View file

@ -1,4 +1,4 @@
extends "res://BuildingVisualBase.gd" extends "res://buildings/BuildingVisualBase.gd"
func _ready() -> void: func _ready() -> void:
_build_lab_pieces() _build_lab_pieces()

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=3] [gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://ShipLabBuildingVisual.gd" id="1"] [ext_resource type="Script" path="res://buildings/ShipLabBuildingVisual.gd" id="1"]
[ext_resource type="Script" path="res://BuildingActionProvider.gd" id="2"] [ext_resource type="Script" path="res://buildings/BuildingActionProvider.gd" id="2"]
[node name="Visual" type="Node2D"] [node name="Visual" type="Node2D"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -1,6 +1,6 @@
[gd_resource type="Resource" script_class="BuildingDefinition" load_steps=3 format=3] [gd_resource type="Resource" script_class="BuildingDefinition" load_steps=3 format=3]
[ext_resource type="Script" path="res://BuildingDefinition.gd" id="1"] [ext_resource type="Script" path="res://buildings/BuildingDefinition.gd" id="1"]
[ext_resource type="PackedScene" path="res://TransportHubBuildingVisual.tscn" id="2"] [ext_resource type="PackedScene" path="res://buildings/TransportHubBuildingVisual.tscn" id="2"]
[resource] [resource]
script = ExtResource("1") script = ExtResource("1")
definition_id = "transport_hub" definition_id = "transport_hub"

View file

@ -1,4 +1,4 @@
extends "res://BuildingVisualBase.gd" extends "res://buildings/BuildingVisualBase.gd"
func _ready() -> void: func _ready() -> void:
_build_hub_pieces() _build_hub_pieces()

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3] [gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://TransportHubBuildingVisual.gd" id="1"] [ext_resource type="Script" path="res://buildings/TransportHubBuildingVisual.gd" id="1"]
[node name="Visual" type="Node2D"] [node name="Visual" type="Node2D"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -1,7 +1,7 @@
extends Node2D extends Node2D
const BUILDING_DEFINITIONS = preload("res://BuildingDefinitions.gd") const BUILDING_DEFINITIONS = preload("res://buildings/BuildingDefinitions.gd")
const VESSEL_DEFINITIONS = preload("res://VesselDefinitions.gd") const VESSEL_DEFINITIONS = preload("res://vessels/VesselDefinitions.gd")
# Space-side building UI. Owns: # Space-side building UI. Owns:
# - the build menu (place a mothership, ship crafter or command centre) # - the build menu (place a mothership, ship crafter or command centre)

View file

@ -1,5 +1,5 @@
class_name GasBombController class_name GasBombController
extends "res://AimedFleetAbilityController.gd" extends "res://controllers/AimedFleetAbilityController.gd"
const BOMB_COLOR := Color(0.96, 0.22, 0.72) const BOMB_COLOR := Color(0.96, 0.22, 0.72)
const TARGET_COLOR := Color(0.78, 0.32, 1.0) const TARGET_COLOR := Color(0.78, 0.32, 1.0)

View file

@ -1,5 +1,5 @@
class_name LaserController class_name LaserController
extends "res://AimedFleetAbilityController.gd" extends "res://controllers/AimedFleetAbilityController.gd"
const BEAM_COLOR := Color(0.3, 0.9, 1.0) const BEAM_COLOR := Color(0.3, 0.9, 1.0)
const TARGET_COLOR := Color(0.6, 0.95, 1.0) const TARGET_COLOR := Color(0.6, 0.95, 1.0)

View file

@ -0,0 +1 @@
uid://bo3rdm8elge8m

View file

@ -1,14 +1,14 @@
extends Node extends Node
const INVENTORY = preload("res://Inventory.gd") const INVENTORY = preload("res://resources/Inventory.gd")
const RESOURCE_DEFINITIONS = preload("res://ResourceDefinitions.gd") const RESOURCE_DEFINITIONS = preload("res://resources/ResourceDefinitions.gd")
const BUILDING_DEFINITIONS = preload("res://BuildingDefinitions.gd") const BUILDING_DEFINITIONS = preload("res://buildings/BuildingDefinitions.gd")
const VESSEL_DEFINITIONS = preload("res://VesselDefinitions.gd") const VESSEL_DEFINITIONS = preload("res://vessels/VesselDefinitions.gd")
const PLANET_DEFINITIONS = preload("res://PlanetDefinitions.gd") const PLANET_DEFINITIONS = preload("res://planets/PlanetDefinitions.gd")
# By path, not by its `WorldGen` global name: an autoload compiles before the # By path, not by its `WorldGen` global name: an autoload compiles before the
# global class table is necessarily populated, the same hazard PlanetSetups.gd # global class table is necessarily populated, the same hazard PlanetSetups.gd
# works around. # works around.
const WORLD_GEN = preload("res://WorldGen.gd") const WORLD_GEN = preload("res://world/WorldGen.gd")
# Autoload singleton - the one thing that survives change_scene_to_file() # Autoload singleton - the one thing that survives change_scene_to_file()

View file

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="EnemyDefinition" load_steps=3 format=3] [gd_resource type="Resource" script_class="EnemyDefinition" load_steps=3 format=3]
[ext_resource type="Script" path="res://EnemyDefinition.gd" id="1"] [ext_resource type="Script" path="res://enemies/EnemyDefinition.gd" id="1"]
[ext_resource type="PackedScene" path="res://EnemyArtilleryComponent.tscn" id="2"] [ext_resource type="PackedScene" path="res://enemies/EnemyArtilleryComponent.tscn" id="2"]
[resource] [resource]
script = ExtResource("1") script = ExtResource("1")

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3] [gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://ArtilleryShell.gd" id="1"] [ext_resource type="Script" path="res://enemies/ArtilleryShell.gd" id="1"]
[node name="ArtilleryShell" type="Node2D"] [node name="ArtilleryShell" type="Node2D"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -1,7 +1,7 @@
[gd_resource type="Resource" script_class="EnemyDefinition" load_steps=3 format=3] [gd_resource type="Resource" script_class="EnemyDefinition" load_steps=3 format=3]
[ext_resource type="Script" path="res://EnemyDefinition.gd" id="1"] [ext_resource type="Script" path="res://enemies/EnemyDefinition.gd" id="1"]
[ext_resource type="PackedScene" path="res://EnemyPursuitComponent.tscn" id="2"] [ext_resource type="PackedScene" path="res://enemies/EnemyPursuitComponent.tscn" id="2"]
[resource] [resource]
script = ExtResource("1") script = ExtResource("1")

View file

@ -2,7 +2,7 @@ extends Area2D
signal destroyed signal destroyed
const ENEMY_DEFINITIONS = preload("res://EnemyDefinitions.gd") const ENEMY_DEFINITIONS = preload("res://enemies/EnemyDefinitions.gd")
@export var enemy_id: String = "chaser" @export var enemy_id: String = "chaser"

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3] [gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://Enemy.gd" id="1"] [ext_resource type="Script" path="res://enemies/Enemy.gd" id="1"]
[sub_resource type="CircleShape2D" id="1"] [sub_resource type="CircleShape2D" id="1"]
radius = 14.0 radius = 14.0

View file

@ -18,7 +18,7 @@ var capability_id: String = "artillery"
@export var color: Color = Color(1.0, 0.5, 0.2) @export var color: Color = Color(1.0, 0.5, 0.2)
var cooldown_left: float = 0.0 var cooldown_left: float = 0.0
var shell_scene: PackedScene = preload("res://ArtilleryShell.tscn") var shell_scene: PackedScene = preload("res://enemies/ArtilleryShell.tscn")
func tick(delta: float) -> void: func tick(delta: float) -> void:

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3] [gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://EnemyArtilleryComponent.gd" id="1"] [ext_resource type="Script" path="res://enemies/EnemyArtilleryComponent.gd" id="1"]
[node name="EnemyArtilleryComponent" type="Node"] [node name="EnemyArtilleryComponent" type="Node"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3] [gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://EnemyBigLaserBeam.gd" id="1"] [ext_resource type="Script" path="res://enemies/EnemyBigLaserBeam.gd" id="1"]
[node name="EnemyBigLaserBeam" type="Node2D"] [node name="EnemyBigLaserBeam" type="Node2D"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -16,7 +16,7 @@ var capability_id: String = "big_laser"
@export var color: Color = Color(0.55, 0.05, 0.85) @export var color: Color = Color(0.55, 0.05, 0.85)
var cooldown_left: float = 0.0 var cooldown_left: float = 0.0
var beam_scene: PackedScene = preload("res://EnemyBigLaserBeam.tscn") var beam_scene: PackedScene = preload("res://enemies/EnemyBigLaserBeam.tscn")
func tick(delta: float) -> void: func tick(delta: float) -> void:

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3] [gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://EnemyBigLaserComponent.gd" id="1"] [ext_resource type="Script" path="res://enemies/EnemyBigLaserComponent.gd" id="1"]
[node name="EnemyBigLaserComponent" type="Node"] [node name="EnemyBigLaserComponent" type="Node"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -4,11 +4,11 @@ extends RefCounted
const DEFAULT_ID: String = "chaser" const DEFAULT_ID: String = "chaser"
const ORDER: PackedStringArray = ["chaser", "sniper", "artillery", "turret_spawner", "enemy_mothership"] const ORDER: PackedStringArray = ["chaser", "sniper", "artillery", "turret_spawner", "enemy_mothership"]
const DEFINITIONS: Dictionary = { const DEFINITIONS: Dictionary = {
"chaser": preload("res://ChaserEnemyDefinition.tres"), "chaser": preload("res://enemies/ChaserEnemyDefinition.tres"),
"sniper": preload("res://SniperEnemyDefinition.tres"), "sniper": preload("res://enemies/SniperEnemyDefinition.tres"),
"artillery": preload("res://ArtilleryEnemyDefinition.tres"), "artillery": preload("res://enemies/ArtilleryEnemyDefinition.tres"),
"turret_spawner": preload("res://TurretSpawnerEnemyDefinition.tres"), "turret_spawner": preload("res://enemies/TurretSpawnerEnemyDefinition.tres"),
"enemy_mothership": preload("res://MothershipEnemyDefinition.tres"), "enemy_mothership": preload("res://enemies/MothershipEnemyDefinition.tres"),
} }

View file

@ -9,7 +9,7 @@ extends Node2D
# glow_color is separate from the definition's own so the editor can tint a # glow_color is separate from the definition's own so the editor can tint a
# selected marker without touching the definition. # selected marker without touching the definition.
const ENEMY_DEFINITIONS = preload("res://EnemyDefinitions.gd") const ENEMY_DEFINITIONS = preload("res://enemies/EnemyDefinitions.gd")
var definition: Resource var definition: Resource
var glow_color: Color = Color(1.0, 0.15, 0.2) var glow_color: Color = Color(1.0, 0.15, 0.2)

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3] [gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://EnemyProjectile.gd" id="1"] [ext_resource type="Script" path="res://enemies/EnemyProjectile.gd" id="1"]
[sub_resource type="CircleShape2D" id="1"] [sub_resource type="CircleShape2D" id="1"]
radius = 4.0 radius = 4.0

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3] [gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://EnemyPursuitComponent.gd" id="1"] [ext_resource type="Script" path="res://enemies/EnemyPursuitComponent.gd" id="1"]
[node name="EnemyPursuitComponent" type="Node"] [node name="EnemyPursuitComponent" type="Node"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3] [gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://EnemyPursuitComponent.gd" id="1"] [ext_resource type="Script" path="res://enemies/EnemyPursuitComponent.gd" id="1"]
[node name="EnemyPursuitComponentMothership" type="Node"] [node name="EnemyPursuitComponentMothership" type="Node"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -13,7 +13,7 @@ var capability_id: String = "ranged_weapon"
@export var damage: int = 1 @export var damage: int = 1
var fire_timer: float = 0.0 var fire_timer: float = 0.0
var projectile_scene: PackedScene = preload("res://EnemyProjectile.tscn") var projectile_scene: PackedScene = preload("res://enemies/EnemyProjectile.tscn")
func tick(delta: float) -> void: func tick(delta: float) -> void:

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3] [gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://EnemyRangedWeaponComponent.gd" id="1"] [ext_resource type="Script" path="res://enemies/EnemyRangedWeaponComponent.gd" id="1"]
[node name="EnemyRangedWeaponComponent" type="Node"] [node name="EnemyRangedWeaponComponent" type="Node"]
script = ExtResource("1") script = ExtResource("1")

View file

@ -6,7 +6,7 @@ extends Node2D
@onready var fleet: Node2D = get_node("../Fleet") @onready var fleet: Node2D = get_node("../Fleet")
var enemy_scene: PackedScene = preload("res://Enemy.tscn") var enemy_scene: PackedScene = preload("res://enemies/Enemy.tscn")
var timer: float = 0.0 var timer: float = 0.0
var next_spawn_time: float = 0.0 var next_spawn_time: float = 0.0

View file

@ -66,7 +66,7 @@ func tick(delta: float) -> void:
var offset: Vector2 = Vector2(cos(angle), sin(angle)) * spawn_radius var offset: Vector2 = Vector2(cos(angle), sin(angle)) * spawn_radius
if enemy_scene == null: if enemy_scene == null:
enemy_scene = load("res://Enemy.tscn") enemy_scene = load("res://enemies/Enemy.tscn")
var new_enemy: Node2D = enemy_scene.instantiate() var new_enemy: Node2D = enemy_scene.instantiate()
new_enemy.enemy_id = spawned_enemy_id new_enemy.enemy_id = spawned_enemy_id
# spawner.position is already expressed in `host`'s local space, and # spawner.position is already expressed in `host`'s local space, and

Some files were not shown because too many files have changed in this diff Show more