No description
Introduce EditorSceneRunner to snapshot/restore scenes and run a play-mode instance (Play/Pause/Stop) inside the editor. Integrate the runner into EditorGame and ViewportPanel so the viewport uses the active game Camera during play, disables editor camera input while playing, and wires the Play/Pause/Stop buttons. Make SceneSerializer public for runtime use, poll the runner from EditorGame.Update, and ensure Time.TimeScale and InputManager are used for pause/resume and per-frame updates. Update docs to mark play-mode features complete and add a sample scene JSON. |
||
|---|---|---|
| .github | ||
| Spelusion.Engine2D | ||
| Spelusion.Engine2D.Core/Docs | ||
| Spelusion.Engine2D.Demo | ||
| Spelusion.Engine2D.Editor | ||
| Spelusion.Engine2D.Tests | ||
| TestGame1 | ||
| .gitignore | ||
| build.cmd | ||
| build.ps1 | ||
| build.sh | ||
| BUILD_SYSTEM.md | ||
| ENGINE_DEVELOPMENT_PLAN.md | ||
| README.md | ||
| Spelusion.Engine2D.slnx | ||
Spelusion.Engine2D
A feature-rich 2D game engine built on MonoGame with Unity-like Entity Component architecture.
?? Overview
Spelusion.Engine2D is a modern 2D game engine designed for developers who want Unity-like workflows with C# and MonoGame. It features:
- Entity Component Architecture (Unity-like, NOT data-oriented ECS)
- Scene Management with JSON serialization
- Texture Atlas Support (TexturePacker integration)
- 2D Camera System with orthographic projection
- Input System with action mapping
- Audio System with spatial audio support
- Decoupled Editor (separate project)
Important: This engine uses Entity Component (EC) architecture, similar to Unity's classic GameObject system, NOT data-oriented Entity Component System (ECS) patterns.
?? Current Status
? Completed Phases
Phase 1: Foundation (Weeks 1-3)
- Core engine structure with GameManager
- Asset management system with TextureAtlas support
- Input system with keyboard/gamepad/mouse
- Audio system with SoundEffect/Song support
- Time management and logging utilities
- Unit tests for core systems
Phase 2: Entity Component System (Weeks 4-6)
- Complete Entity Component architecture
- Transform, Sprite, and Camera components
- Scene management with lifecycle methods
- JSON serialization for scenes and entities
- Prefab system with instantiation
- Working demo with ghostly01 texture atlas
- Comprehensive unit and integration tests
?? Next Phase: Phase 3 (Weeks 7-9)
- Collision and physics system
- State machine system
- Particle system
- UI framework
??? Architecture
Entity Component (EC) Pattern
// Create an entity
var player = new Entity("Player");
player.Tag = "Player";
// Add components
var sprite = new Sprite();
sprite.SetSprite(textureAtlas, "ghost-idle-01");
player.AddComponent(sprite);
// Add to scene
scene.AddEntity(player);
Scene Management
// Create and load scene
var scene = new Scene("MainScene");
scene.Load();
// Update and render
scene.Update(gameTime);
scene.Draw(spriteBatch, gameTime);
?? Installation
Prerequisites
- .NET 10.0 SDK
- MonoGame 3.8.4.1
Clone and Build
git clone https://git.spelusion.com/david/Spelusion.Engine2D.git
cd Spelusion.Engine2D
dotnet build
Run Demo
cd Spelusion.Engine2D.Demo
dotnet run
?? Documentation
Core Documentation
- Phase 1 Implementation Summary
- Phase 2 Implementation Summary
- Ghostly01 Sprite Reference
- Development Plan
Usage Examples
?? Testing
Run unit tests:
dotnet test
?? Features
? Implemented
- Entity Component architecture (Unity-like)
- Scene management with serialization
- Texture atlas support (TexturePacker JSON)
- 2D camera system with zoom/rotation
- Input system with action mapping
- Audio system with spatial audio
- JSON serialization for all data
- Prefab system
- Object pooling for performance
- Comprehensive logging and error handling
?? In Development
- Collision detection and physics
- State machine system
- Particle effects
- UI framework
?? Planned
- Decoupled editor application
- Animation system
- Tilemap support
- Plugin system
- Advanced audio features
??? Project Structure
Spelusion.Engine2D/
??? Core/ # GameManager, Time, Configuration
??? Assets/ # AssetRepository, TextureAtlas
??? Scenes/ # Entity, Components, Scene management
??? Input/ # InputManager, KeyBinding
??? Audio/ # AudioPlayer, Sound management
??? Serialization/ # JSON converters, SerializationManager
??? Prefabs/ # Prefab system
??? Extensions/ # SpriteBatch extensions
??? Helpers/ # DebugGraphics, GameTimer
??? Docs/ # Documentation
Spelusion.Engine2D.Demo/ # Demo application
Spelusion.Engine2D.Editor/ # Editor application (future)
Spelusion.Engine2D.Tests/ # Unit and integration tests
?? Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Update documentation
- Submit a pull request
?? License
This project is licensed under the MIT License - see the LICENSE file for details.
?? Acknowledgments
- Built on MonoGame framework
- Inspired by Unity's component architecture
- Texture atlas support via TexturePacker
?? Support
For questions, issues, or contributions:
- Create an issue on GitHub
- Check the documentation first
- Review the development plan
Version: 0.2.0 (Phase 2 Complete)
Last Updated: 2024
Engine Architecture: Entity Component (EC) - Unity-like