A 2D action game built with Blazor WebAssembly. Control a rocket-shaped spaceship connected to a massive sphere and navigate through space.
- Arrow Keys: Rotate the spaceship left/right
- Space Bar: Fire the engine for thrust
- Physics: The game features realistic air resistance, gravity effects, and a rigid connection between the spaceship and a massive sphere
The spaceship is connected to a massive sphere with a rigid connection. When you apply thrust, the force is split between:
- Force components parallel to the connection (affecting both objects based on their mass ratio)
- Force components perpendicular to the connection (affecting only the spaceship)
This creates interesting movement dynamics where the spaceship and sphere influence each other's motion.
- Game: The main game with full physics simulation
- Simple Game: A simplified version that uses direct JavaScript rendering without complex interop
- Debug Test: A test page for troubleshooting JavaScript interop issues
If you encounter the "Could not find 'drawGame'" error:
- Try the Simple Game version: This uses direct JavaScript eval calls which are more reliable
- Check browser console: Look for JavaScript errors
- Verify JavaScript files are loaded: Both game.js and game-interop.js should be loaded
- Fallback mechanisms: The game includes multiple rendering fallbacks:
- Primary: gameInterop.drawGame function
- Secondary: drawTest function
- Last resort: Direct JavaScript eval with simplified rendering
- Built with C# and Blazor WebAssembly
- Renders on HTML Canvas
- Runs entirely in the browser (no server-side logic required)
- Implements a realistic physics model including momentum, gravity, and air resistance
- .NET 8 SDK or newer
-
Clone the repository
git clone https://github.com/yourusername/MassInertia.git cd MassInertia -
Build and run the project
dotnet build dotnet run
-
Navigate to the provided URL in your browser (typically http://localhost:5000)
This project is intended for educational and demonstration purposes.