Restructure codebase into logical subdirectories
All checks were successful
Build / build (push) Successful in 1m20s
All checks were successful
Build / build (push) Successful in 1m20s
## Major Reorganization
Reorganized all 57 TypeScript files from flat src/ directory into logical subdirectories for improved maintainability and discoverability.
## New Directory Structure
```
src/
├── core/ (4 files)
│ └── Foundation modules: defaultScene, gameConfig, debug, router
│
├── ship/ (10 files)
│ ├── Ship coordination and subsystems
│ └── input/ - VR controller and keyboard input
│
├── levels/ (10 files)
│ ├── config/ - Level schema, serialization, deserialization
│ ├── generation/ - Level generator and editor
│ └── ui/ - Level selector
│
├── environment/ (11 files)
│ ├── asteroids/ - Rock factory and explosions
│ ├── celestial/ - Suns, planets, textures
│ ├── stations/ - Star base loading
│ └── background/ - Stars, mirror, radar
│
├── ui/ (9 files)
│ ├── hud/ - Scoreboard and status screen
│ ├── screens/ - Login, settings, preloader
│ └── widgets/ - Discord integration
│
├── replay/ (7 files)
│ ├── Replay system components
│ └── recording/ - Physics recording and storage
│
├── game/ (3 files)
│ └── Game systems: stats, progression, demo
│
├── services/ (2 files)
│ └── External integrations: auth, social
│
└── utils/ (5 files)
└── Shared utilities and helpers
```
## Changes Made
### File Moves (57 files)
- Core modules: 4 files → core/
- Ship system: 10 files → ship/ + ship/input/
- Level system: 10 files → levels/ (+ 3 subdirs)
- Environment: 11 files → environment/ (+ 4 subdirs)
- UI components: 9 files → ui/ (+ 3 subdirs)
- Replay system: 7 files → replay/ + replay/recording/
- Game systems: 3 files → game/
- Services: 2 files → services/
- Utilities: 5 files → utils/
### Import Path Updates
- Updated ~200 import statements across all files
- Fixed relative paths based on new directory structure
- Fixed case-sensitive import issues (physicsRecorder, physicsStorage)
- Ensured consistent lowercase filenames for imports
## Benefits
1. **Easy Navigation** - Related code grouped together
2. **Clear Boundaries** - Logical separation of concerns
3. **Scalability** - Easy pattern for adding new features
4. **Discoverability** - Find ship code in /ship, levels in /levels, etc.
5. **Maintainability** - Isolated modules easier to update
6. **No Circular Dependencies** - Clean dependency graph maintained
## Testing
- All TypeScript compilation errors resolved
- Build succeeds with new structure
- Import paths verified and corrected
- Case-sensitivity issues fixed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
ee90e420d6
commit
0dc3c9d68d
@ -1,14 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
AbstractMesh,
|
AbstractMesh,
|
||||||
Animation, Color3,
|
|
||||||
Mesh, MeshBuilder,
|
Mesh, MeshBuilder,
|
||||||
MeshExploder,
|
MeshExploder,
|
||||||
Scene,
|
Scene,
|
||||||
Vector3,
|
Vector3
|
||||||
VertexData
|
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import {DefaultScene} from "./defaultScene";
|
import {DefaultScene} from "../../core/defaultScene";
|
||||||
import debugLog from './debug';
|
import debugLog from '../../core/debug';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration for explosion effects
|
* Configuration for explosion effects
|
||||||
@ -77,6 +75,7 @@ export class ExplosionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create sphere debris scattered around the original mesh position
|
// Create sphere debris scattered around the original mesh position
|
||||||
|
debugLog(baseScale);
|
||||||
const avgScale = (baseScale.x + baseScale.y + baseScale.z) / 3;
|
const avgScale = (baseScale.x + baseScale.y + baseScale.z) / 3;
|
||||||
const debrisSize = avgScale * 0.3; // Size relative to asteroid
|
const debrisSize = avgScale * 0.3; // Size relative to asteroid
|
||||||
|
|
||||||
@ -13,12 +13,12 @@ import {
|
|||||||
TransformNode,
|
TransformNode,
|
||||||
Vector3
|
Vector3
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import {DefaultScene} from "./defaultScene";
|
import {DefaultScene} from "../../core/defaultScene";
|
||||||
import {ScoreEvent} from "./scoreboard";
|
import {ScoreEvent} from "../../ui/hud/scoreboard";
|
||||||
import {GameConfig} from "./gameConfig";
|
import {GameConfig} from "../../core/gameConfig";
|
||||||
import {ExplosionManager} from "./explosionManager";
|
import {ExplosionManager} from "./explosionManager";
|
||||||
import debugLog from './debug';
|
import debugLog from '../../core/debug';
|
||||||
import loadAsset from "./utils/loadAsset";
|
import loadAsset from "../../utils/loadAsset";
|
||||||
|
|
||||||
export class Rock {
|
export class Rock {
|
||||||
private _rockMesh: AbstractMesh;
|
private _rockMesh: AbstractMesh;
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import {Color3, Color4, PointsCloudSystem, Scene, StandardMaterial, Vector3} from "@babylonjs/core";
|
import {Color3, Color4, PointsCloudSystem, Scene, StandardMaterial, Vector3} from "@babylonjs/core";
|
||||||
import debugLog from './debug';
|
import debugLog from '../../core/debug';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration options for background stars
|
* Configuration options for background stars
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import {FreeCamera, MeshBuilder, RenderTargetTexture, StandardMaterial, TransformNode, Vector3} from "@babylonjs/core";
|
import {FreeCamera, MeshBuilder, RenderTargetTexture, StandardMaterial, TransformNode, Vector3} from "@babylonjs/core";
|
||||||
import {DefaultScene} from "./defaultScene";
|
import {DefaultScene} from "../../core/defaultScene";
|
||||||
|
|
||||||
export class Mirror {
|
export class Mirror {
|
||||||
constructor(ship: TransformNode) {
|
constructor(ship: TransformNode) {
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import {DefaultScene} from "./defaultScene";
|
import {DefaultScene} from "../../core/defaultScene";
|
||||||
import {
|
import {
|
||||||
AbstractMesh,
|
AbstractMesh,
|
||||||
Color3,
|
Color3,
|
||||||
@ -5,9 +5,9 @@ import {
|
|||||||
Texture,
|
Texture,
|
||||||
Vector3
|
Vector3
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import { DefaultScene } from "./defaultScene";
|
import { DefaultScene } from "../../core/defaultScene";
|
||||||
import { getRandomPlanetTexture } from "./planetTextures";
|
import { getRandomPlanetTexture } from "./planetTextures";
|
||||||
import debugLog from './debug';
|
import debugLog from '../../core/debug';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates multiple planets with random textures, sizes, and positions
|
* Creates multiple planets with random textures, sizes, and positions
|
||||||
@ -9,7 +9,7 @@ import {
|
|||||||
StandardMaterial, Texture,
|
StandardMaterial, Texture,
|
||||||
Vector3
|
Vector3
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import {DefaultScene} from "./defaultScene";
|
import {DefaultScene} from "../../core/defaultScene";
|
||||||
import {FireProceduralTexture} from "@babylonjs/procedural-textures";
|
import {FireProceduralTexture} from "@babylonjs/procedural-textures";
|
||||||
|
|
||||||
export function createSun() : AbstractMesh {
|
export function createSun() : AbstractMesh {
|
||||||
@ -6,11 +6,11 @@ import {
|
|||||||
PhysicsShapeType,
|
PhysicsShapeType,
|
||||||
Vector3
|
Vector3
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import {DefaultScene} from "./defaultScene";
|
import {DefaultScene} from "../../core/defaultScene";
|
||||||
import {GameConfig} from "./gameConfig";
|
import {GameConfig} from "../../core/gameConfig";
|
||||||
import debugLog from "./debug";
|
import debugLog from "../../core/debug";
|
||||||
import loadAsset from "./utils/loadAsset";
|
import loadAsset from "../../utils/loadAsset";
|
||||||
import {Vector3Array} from "./levelConfig";
|
import {Vector3Array} from "../../levels/config/levelConfig";
|
||||||
|
|
||||||
export interface StarBaseResult {
|
export interface StarBaseResult {
|
||||||
baseMesh: AbstractMesh;
|
baseMesh: AbstractMesh;
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import {DefaultScene} from "./defaultScene";
|
import {DefaultScene} from "../core/defaultScene";
|
||||||
import {ArcRotateCamera, MeshBuilder, PointerEventTypes, Vector3} from "@babylonjs/core";
|
import {ArcRotateCamera, MeshBuilder, PointerEventTypes, Vector3} from "@babylonjs/core";
|
||||||
import {Main} from "./main";
|
import {Main} from "../main";
|
||||||
|
|
||||||
export default class Demo {
|
export default class Demo {
|
||||||
private _main: Main;
|
private _main: Main;
|
||||||
@ -8,9 +8,9 @@ import {
|
|||||||
Texture,
|
Texture,
|
||||||
Vector3,
|
Vector3,
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import { DefaultScene } from "./defaultScene";
|
import { DefaultScene } from "../../core/defaultScene";
|
||||||
import { RockFactory } from "./rockFactory";
|
import { RockFactory } from "../../environment/asteroids/rockFactory";
|
||||||
import { ScoreEvent } from "./scoreboard";
|
import { ScoreEvent } from "../../ui/hud/scoreboard";
|
||||||
import {
|
import {
|
||||||
LevelConfig,
|
LevelConfig,
|
||||||
ShipConfig,
|
ShipConfig,
|
||||||
@ -18,9 +18,9 @@ import {
|
|||||||
validateLevelConfig
|
validateLevelConfig
|
||||||
} from "./levelConfig";
|
} from "./levelConfig";
|
||||||
import { FireProceduralTexture } from "@babylonjs/procedural-textures";
|
import { FireProceduralTexture } from "@babylonjs/procedural-textures";
|
||||||
import { createSphereLightmap } from "./sphereLightmap";
|
import { createSphereLightmap } from "../../environment/celestial/sphereLightmap";
|
||||||
import debugLog from './debug';
|
import debugLog from '../../core/debug';
|
||||||
import StarBase from "./starBase";
|
import StarBase from "../../environment/stations/starBase";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deserializes a LevelConfig JSON object and creates all entities in the scene
|
* Deserializes a LevelConfig JSON object and creates all entities in the scene
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { Vector3, Quaternion, Material, PBRMaterial, StandardMaterial, AbstractMesh, TransformNode } from "@babylonjs/core";
|
import { Vector3, Quaternion, Material, PBRMaterial, StandardMaterial, AbstractMesh, TransformNode } from "@babylonjs/core";
|
||||||
import { DefaultScene } from "./defaultScene";
|
import { DefaultScene } from "../../core/defaultScene";
|
||||||
import {
|
import {
|
||||||
LevelConfig,
|
LevelConfig,
|
||||||
ShipConfig,
|
ShipConfig,
|
||||||
@ -13,7 +13,7 @@ import {
|
|||||||
MaterialConfig,
|
MaterialConfig,
|
||||||
SceneNodeConfig
|
SceneNodeConfig
|
||||||
} from "./levelConfig";
|
} from "./levelConfig";
|
||||||
import debugLog from './debug';
|
import debugLog from '../../core/debug';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serializes the current runtime state of a level to JSON configuration
|
* Serializes the current runtime state of a level to JSON configuration
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import { LevelGenerator } from "./levelGenerator";
|
import { LevelGenerator } from "./levelGenerator";
|
||||||
import { LevelConfig, DifficultyConfig, validateLevelConfig, Vector3Array } from "./levelConfig";
|
import { LevelConfig, DifficultyConfig, validateLevelConfig, Vector3Array } from "../config/levelConfig";
|
||||||
import debugLog from './debug';
|
import debugLog from '../../core/debug';
|
||||||
|
|
||||||
const STORAGE_KEY = 'space-game-levels';
|
const STORAGE_KEY = 'space-game-levels';
|
||||||
|
|
||||||
@ -7,8 +7,8 @@ import {
|
|||||||
AsteroidConfig,
|
AsteroidConfig,
|
||||||
DifficultyConfig,
|
DifficultyConfig,
|
||||||
Vector3Array
|
Vector3Array
|
||||||
} from "./levelConfig";
|
} from "../config/levelConfig";
|
||||||
import { getRandomPlanetTexture } from "./planetTextures";
|
import { getRandomPlanetTexture } from "../../environment/celestial/planetTextures";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates procedural level configurations matching the current Level1 generation logic
|
* Generates procedural level configurations matching the current Level1 generation logic
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import {DefaultScene} from "./defaultScene";
|
import {DefaultScene} from "../core/defaultScene";
|
||||||
import type {AudioEngineV2, StaticSound} from "@babylonjs/core";
|
import type {AudioEngineV2, StaticSound} from "@babylonjs/core";
|
||||||
import {
|
import {
|
||||||
AbstractMesh,
|
AbstractMesh,
|
||||||
@ -7,14 +7,14 @@ import {
|
|||||||
Vector3,
|
Vector3,
|
||||||
WebXRState
|
WebXRState
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import {Ship} from "./ship";
|
import {Ship} from "../ship/ship";
|
||||||
import Level from "./level";
|
import Level from "./level";
|
||||||
import setLoadingMessage from "./setLoadingMessage";
|
import setLoadingMessage from "../utils/setLoadingMessage";
|
||||||
import {LevelConfig} from "./levelConfig";
|
import {LevelConfig} from "./config/levelConfig";
|
||||||
import {LevelDeserializer} from "./levelDeserializer";
|
import {LevelDeserializer} from "./config/levelDeserializer";
|
||||||
import {BackgroundStars} from "./backgroundStars";
|
import {BackgroundStars} from "../environment/background/backgroundStars";
|
||||||
import debugLog from './debug';
|
import debugLog from '../core/debug';
|
||||||
import {PhysicsRecorder} from "./physicsRecorder";
|
import {PhysicsRecorder} from "../replay/recording/physicsRecorder";
|
||||||
|
|
||||||
export class Level1 implements Level {
|
export class Level1 implements Level {
|
||||||
private _ship: Ship;
|
private _ship: Ship;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { DefaultScene } from "./defaultScene";
|
import { DefaultScene } from "../core/defaultScene";
|
||||||
import {
|
import {
|
||||||
Color3,
|
Color3,
|
||||||
DirectionalLight,
|
DirectionalLight,
|
||||||
@ -9,7 +9,7 @@ import {
|
|||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import type { AudioEngineV2 } from "@babylonjs/core";
|
import type { AudioEngineV2 } from "@babylonjs/core";
|
||||||
import Level from "./level";
|
import Level from "./level";
|
||||||
import debugLog from './debug';
|
import debugLog from '../core/debug';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minimal test level with just a box and a light for debugging
|
* Minimal test level with just a box and a light for debugging
|
||||||
@ -1,9 +1,9 @@
|
|||||||
import { getSavedLevels } from "./levelEditor";
|
import { getSavedLevels } from "../generation/levelEditor";
|
||||||
import { LevelConfig } from "./levelConfig";
|
import { LevelConfig } from "../config/levelConfig";
|
||||||
import { ProgressionManager } from "./progression";
|
import { ProgressionManager } from "../../game/progression";
|
||||||
import { GameConfig } from "./gameConfig";
|
import { GameConfig } from "../../core/gameConfig";
|
||||||
import { AuthService } from "./authService";
|
import { AuthService } from "../../services/authService";
|
||||||
import debugLog from './debug';
|
import debugLog from '../../core/debug';
|
||||||
|
|
||||||
const SELECTED_LEVEL_KEY = 'space-game-selected-level';
|
const SELECTED_LEVEL_KEY = 'space-game-selected-level';
|
||||||
|
|
||||||
38
src/main.ts
38
src/main.ts
@ -14,25 +14,25 @@ import {
|
|||||||
import '@babylonjs/loaders';
|
import '@babylonjs/loaders';
|
||||||
import HavokPhysics from "@babylonjs/havok";
|
import HavokPhysics from "@babylonjs/havok";
|
||||||
|
|
||||||
import {DefaultScene} from "./defaultScene";
|
import {DefaultScene} from "./core/defaultScene";
|
||||||
import {Level1} from "./level1";
|
import {Level1} from "./levels/level1";
|
||||||
import {TestLevel} from "./testLevel";
|
import {TestLevel} from "./levels/testLevel";
|
||||||
import Demo from "./demo";
|
import Demo from "./game/demo";
|
||||||
import Level from "./level";
|
import Level from "./levels/level";
|
||||||
import setLoadingMessage from "./setLoadingMessage";
|
import setLoadingMessage from "./utils/setLoadingMessage";
|
||||||
import {RockFactory} from "./rockFactory";
|
import {RockFactory} from "./environment/asteroids/rockFactory";
|
||||||
import {ControllerDebug} from "./controllerDebug";
|
import {ControllerDebug} from "./utils/controllerDebug";
|
||||||
import {router, showView} from "./router";
|
import {router, showView} from "./core/router";
|
||||||
import {populateLevelSelector} from "./levelSelector";
|
import {populateLevelSelector} from "./levels/ui/levelSelector";
|
||||||
import {LevelConfig} from "./levelConfig";
|
import {LevelConfig} from "./levels/config/levelConfig";
|
||||||
import {generateDefaultLevels} from "./levelEditor";
|
import {generateDefaultLevels} from "./levels/generation/levelEditor";
|
||||||
import debugLog from './debug';
|
import debugLog from './core/debug';
|
||||||
import {ReplaySelectionScreen} from "./replay/ReplaySelectionScreen";
|
import {ReplaySelectionScreen} from "./replay/ReplaySelectionScreen";
|
||||||
import {ReplayManager} from "./replay/ReplayManager";
|
import {ReplayManager} from "./replay/ReplayManager";
|
||||||
import {AuthService} from "./authService";
|
import {AuthService} from "./services/authService";
|
||||||
import {updateUserProfile} from "./loginScreen";
|
import {updateUserProfile} from "./ui/screens/loginScreen";
|
||||||
import {Preloader} from "./preloader";
|
import {Preloader} from "./ui/screens/preloader";
|
||||||
import {DiscordWidget} from "./discordWidget";
|
import {DiscordWidget} from "./ui/widgets/discordWidget";
|
||||||
|
|
||||||
// Set to true to run minimal controller debug test
|
// Set to true to run minimal controller debug test
|
||||||
const DEBUG_CONTROLLERS = false;
|
const DEBUG_CONTROLLERS = false;
|
||||||
@ -654,7 +654,7 @@ router.on('/editor', () => {
|
|||||||
showView('editor');
|
showView('editor');
|
||||||
// Dynamically import and initialize editor
|
// Dynamically import and initialize editor
|
||||||
if (!(window as any).__editorInitialized) {
|
if (!(window as any).__editorInitialized) {
|
||||||
import('./levelEditor').then(() => {
|
import('./levels/generation/levelEditor').then(() => {
|
||||||
(window as any).__editorInitialized = true;
|
(window as any).__editorInitialized = true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -664,7 +664,7 @@ router.on('/settings', () => {
|
|||||||
showView('settings');
|
showView('settings');
|
||||||
// Dynamically import and initialize settings
|
// Dynamically import and initialize settings
|
||||||
if (!(window as any).__settingsInitialized) {
|
if (!(window as any).__settingsInitialized) {
|
||||||
import('./settingsScreen').then((module) => {
|
import('./ui/screens/settingsScreen').then((module) => {
|
||||||
module.initializeSettingsScreen();
|
module.initializeSettingsScreen();
|
||||||
(window as any).__settingsInitialized = true;
|
(window as any).__settingsInitialized = true;
|
||||||
});
|
});
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import {
|
|||||||
Scene,
|
Scene,
|
||||||
Vector3
|
Vector3
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import debugLog from "../debug";
|
import debugLog from "../core/debug";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Camera modes for replay viewing
|
* Camera modes for replay viewing
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import {
|
|||||||
} from "@babylonjs/gui";
|
} from "@babylonjs/gui";
|
||||||
import { ReplayPlayer } from "./ReplayPlayer";
|
import { ReplayPlayer } from "./ReplayPlayer";
|
||||||
import { CameraMode, ReplayCamera } from "./ReplayCamera";
|
import { CameraMode, ReplayCamera } from "./ReplayCamera";
|
||||||
import debugLog from "../debug";
|
import debugLog from "../core/debug";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UI controls for replay playback
|
* UI controls for replay playback
|
||||||
|
|||||||
@ -8,13 +8,13 @@ import {
|
|||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import "@babylonjs/inspector";
|
import "@babylonjs/inspector";
|
||||||
import HavokPhysics from "@babylonjs/havok";
|
import HavokPhysics from "@babylonjs/havok";
|
||||||
import { PhysicsStorage } from "../physicsStorage";
|
import { PhysicsStorage } from "./recording/physicsStorage";
|
||||||
import { ReplayPlayer } from "./ReplayPlayer";
|
import { ReplayPlayer } from "./ReplayPlayer";
|
||||||
import { CameraMode, ReplayCamera } from "./ReplayCamera";
|
import { CameraMode, ReplayCamera } from "./ReplayCamera";
|
||||||
import { ReplayControls } from "./ReplayControls";
|
import { ReplayControls } from "./ReplayControls";
|
||||||
import debugLog from "../debug";
|
import debugLog from "../core/debug";
|
||||||
import { DefaultScene } from "../defaultScene";
|
import { DefaultScene } from "../core/defaultScene";
|
||||||
import { Level1 } from "../level1";
|
import { Level1 } from "../levels/level1";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages the replay scene, loading recordings, and coordinating replay components
|
* Manages the replay scene, loading recordings, and coordinating replay components
|
||||||
|
|||||||
@ -5,8 +5,8 @@ import {
|
|||||||
Scene,
|
Scene,
|
||||||
Vector3
|
Vector3
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import { PhysicsRecording, PhysicsSnapshot } from "../physicsRecorder";
|
import { PhysicsRecording, PhysicsSnapshot } from "./recording/physicsRecorder";
|
||||||
import debugLog from "../debug";
|
import debugLog from "../core/debug";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles frame-by-frame playback of physics recordings
|
* Handles frame-by-frame playback of physics recordings
|
||||||
|
|||||||
@ -7,8 +7,8 @@ import {
|
|||||||
StackPanel,
|
StackPanel,
|
||||||
TextBlock
|
TextBlock
|
||||||
} from "@babylonjs/gui";
|
} from "@babylonjs/gui";
|
||||||
import { PhysicsStorage } from "../physicsStorage";
|
import { PhysicsStorage } from "./recording/physicsStorage";
|
||||||
import debugLog from "../debug";
|
import debugLog from "../core/debug";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recording info for display
|
* Recording info for display
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { Scene, Vector3, Quaternion, AbstractMesh } from "@babylonjs/core";
|
import { Scene, Vector3, Quaternion, AbstractMesh } from "@babylonjs/core";
|
||||||
import debugLog from "./debug";
|
import debugLog from "../../core/debug";
|
||||||
import { PhysicsStorage } from "./physicsStorage";
|
import { PhysicsStorage } from "./physicsStorage";
|
||||||
import { LevelConfig } from "./levelConfig";
|
import { LevelConfig } from "../../levels/config/levelConfig";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the physics state of a single object at a point in time
|
* Represents the physics state of a single object at a point in time
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import { PhysicsRecording, PhysicsSnapshot } from "./physicsRecorder";
|
import { PhysicsRecording, PhysicsSnapshot } from "./physicsRecorder";
|
||||||
import debugLog from "./debug";
|
import debugLog from "../../core/debug";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IndexedDB storage for physics recordings
|
* IndexedDB storage for physics recordings
|
||||||
@ -5,7 +5,7 @@ import {
|
|||||||
WebXRControllerComponent,
|
WebXRControllerComponent,
|
||||||
WebXRInputSource,
|
WebXRInputSource,
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import debugLog from "./debug";
|
import debugLog from "../../core/debug";
|
||||||
|
|
||||||
const controllerComponents = [
|
const controllerComponents = [
|
||||||
"a-button",
|
"a-button",
|
||||||
@ -13,20 +13,20 @@ import {
|
|||||||
WebXRInputSource,
|
WebXRInputSource,
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import type { AudioEngineV2 } from "@babylonjs/core";
|
import type { AudioEngineV2 } from "@babylonjs/core";
|
||||||
import { DefaultScene } from "./defaultScene";
|
import { DefaultScene } from "../core/defaultScene";
|
||||||
import { GameConfig } from "./gameConfig";
|
import { GameConfig } from "../core/gameConfig";
|
||||||
import { Sight } from "./sight";
|
import { Sight } from "./sight";
|
||||||
import debugLog from "./debug";
|
import debugLog from "../core/debug";
|
||||||
import { Scoreboard } from "./scoreboard";
|
import { Scoreboard } from "../ui/hud/scoreboard";
|
||||||
import loadAsset from "./utils/loadAsset";
|
import loadAsset from "../utils/loadAsset";
|
||||||
import { Debug } from "@babylonjs/core/Legacy/legacy";
|
import { Debug } from "@babylonjs/core/Legacy/legacy";
|
||||||
import { KeyboardInput } from "./keyboardInput";
|
import { KeyboardInput } from "./input/keyboardInput";
|
||||||
import { ControllerInput } from "./controllerInput";
|
import { ControllerInput } from "./input/controllerInput";
|
||||||
import { ShipPhysics } from "./shipPhysics";
|
import { ShipPhysics } from "./shipPhysics";
|
||||||
import { ShipAudio } from "./shipAudio";
|
import { ShipAudio } from "./shipAudio";
|
||||||
import { WeaponSystem } from "./weaponSystem";
|
import { WeaponSystem } from "./weaponSystem";
|
||||||
import { StatusScreen } from "./statusScreen";
|
import { StatusScreen } from "../ui/hud/statusScreen";
|
||||||
import { GameStats } from "./gameStats";
|
import { GameStats } from "../game/gameStats";
|
||||||
|
|
||||||
export class Ship {
|
export class Ship {
|
||||||
private _ship: TransformNode;
|
private _ship: TransformNode;
|
||||||
@ -7,7 +7,7 @@ import {
|
|||||||
TransformNode,
|
TransformNode,
|
||||||
Vector3
|
Vector3
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import {DefaultScene} from "./defaultScene";
|
import {DefaultScene} from "../core/defaultScene";
|
||||||
|
|
||||||
type MainEngine = {
|
type MainEngine = {
|
||||||
transformNode: TransformNode;
|
transformNode: TransformNode;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { PhysicsBody, TransformNode, Vector2, Vector3 } from "@babylonjs/core";
|
import { PhysicsBody, TransformNode, Vector2, Vector3 } from "@babylonjs/core";
|
||||||
import { GameConfig } from "./gameConfig";
|
import { GameConfig } from "../core/gameConfig";
|
||||||
import { ShipStatus } from "./shipStatus";
|
import { ShipStatus } from "./shipStatus";
|
||||||
import { GameStats } from "./gameStats";
|
import { GameStats } from "../game/gameStats";
|
||||||
|
|
||||||
export interface InputState {
|
export interface InputState {
|
||||||
leftStick: Vector2;
|
leftStick: Vector2;
|
||||||
@ -12,9 +12,9 @@ import {
|
|||||||
TransformNode,
|
TransformNode,
|
||||||
Vector3,
|
Vector3,
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import { GameConfig } from "./gameConfig";
|
import { GameConfig } from "../core/gameConfig";
|
||||||
import { ShipStatus } from "./shipStatus";
|
import { ShipStatus } from "./shipStatus";
|
||||||
import { GameStats } from "./gameStats";
|
import { GameStats } from "../game/gameStats";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles weapon firing and projectile lifecycle
|
* Handles weapon firing and projectile lifecycle
|
||||||
@ -1,13 +1,13 @@
|
|||||||
import {AdvancedDynamicTexture, Control, StackPanel, TextBlock, Rectangle, Container} from "@babylonjs/gui";
|
import {AdvancedDynamicTexture, Control, StackPanel, TextBlock, Rectangle, Container} from "@babylonjs/gui";
|
||||||
import {DefaultScene} from "./defaultScene";
|
import {DefaultScene} from "../../core/defaultScene";
|
||||||
import {
|
import {
|
||||||
Mesh,
|
Mesh,
|
||||||
MeshBuilder,
|
MeshBuilder,
|
||||||
Observable,
|
Observable,
|
||||||
Vector3,
|
Vector3,
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import debugLog from './debug';
|
import debugLog from '../../core/debug';
|
||||||
import { ShipStatus } from './shipStatus';
|
import { ShipStatus } from '../../ship/shipStatus';
|
||||||
|
|
||||||
export type ScoreEvent = {
|
export type ScoreEvent = {
|
||||||
score: number,
|
score: number,
|
||||||
@ -14,11 +14,11 @@ import {
|
|||||||
StandardMaterial,
|
StandardMaterial,
|
||||||
Vector3
|
Vector3
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import { GameStats } from "./gameStats";
|
import { GameStats } from "../../game/gameStats";
|
||||||
import { DefaultScene } from "./defaultScene";
|
import { DefaultScene } from "../../core/defaultScene";
|
||||||
import { ProgressionManager } from "./progression";
|
import { ProgressionManager } from "../../game/progression";
|
||||||
import { AuthService } from "./authService";
|
import { AuthService } from "../../services/authService";
|
||||||
import { FacebookShare, ShareData } from "./facebookShare";
|
import { FacebookShare, ShareData } from "../../services/facebookShare";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Status screen that displays game statistics
|
* Status screen that displays game statistics
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { AuthService } from './authService';
|
import { AuthService } from '../../services/authService';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and displays the login screen UI
|
* Creates and displays the login screen UI
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import { GameConfig } from "./gameConfig";
|
import { GameConfig } from "../../core/gameConfig";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the settings screen
|
* Initialize the settings screen
|
||||||
@ -7,7 +7,7 @@ import {
|
|||||||
WebXRDefaultExperience,
|
WebXRDefaultExperience,
|
||||||
Color3
|
Color3
|
||||||
} from "@babylonjs/core";
|
} from "@babylonjs/core";
|
||||||
import debugLog from './debug';
|
import debugLog from '../core/debug';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minimal standalone class to debug WebXR controller detection
|
* Minimal standalone class to debug WebXR controller detection
|
||||||
@ -1,6 +1,6 @@
|
|||||||
import {DefaultScene} from "../defaultScene";
|
import {DefaultScene} from "../core/defaultScene";
|
||||||
import {AbstractMesh, AssetContainer, LoadAssetContainerAsync} from "@babylonjs/core";
|
import {AbstractMesh, AssetContainer, LoadAssetContainerAsync} from "@babylonjs/core";
|
||||||
import debugLog from "../debug";
|
import debugLog from "../core/debug";
|
||||||
|
|
||||||
export type LoadedAsset = {
|
export type LoadedAsset = {
|
||||||
container: AssetContainer,
|
container: AssetContainer,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user