SOVEREIGN ENGINE
High Score: 0
Spend your score on upgrades!
Score: 0
Final Score: 0
Hackable. Modular. Yours.
Welcome, builder! This engine is yours to command. Here's how to write your own mods.
Define how your weapon fires using the function: function shoot(player, target, engine)
. To fire a bullet, add an object to engine.projectiles
.
// Example: A slow, powerful shot
engine.projectiles.push({
x: player.x, y: player.y,
vx: (target.x - player.x) / 5,
vy: (target.y - player.y) / 5,
size: 8, color: '#ff00ff',
life: 3, // Seconds until it disappears
damage: 50
});
Control the game's logic every frame using: function update(engine, dt)
. You can use it to control enemy spawning, difficulty, or any other global game logic. Use dt
(delta-time) for smooth, frame-rate independent logic.
// Spawn a special enemy every 5 seconds
if (engine.gameTime % 5 < dt) {
engine.spawnEnemy({
health: 100, size: 15,
color: '#00ffff',
ai_type: 'linear' // or 'chase'
});
}
Change your character's stats using: function modifyPlayer(player)
. This is run once when you click "Apply".
// Make the player super fast!
player.speed = 500;
player.color = '#ffff00';
Use the Save button to store your creations. They'll be here next time you play! The Hack The System panel gives you direct, raw access to the entire 'game' object. Use with caution... or don't!