Build Your First Game
Go from zero to a published game at your-slug.siliconghetto.com in 15 minutes.
Step 1: Sign Up
Visit siliconghetto.com and create a free account. You get a subdomain instantly.
Step 2: Open the Editor
Click “New Game” in your dashboard. You’ll see three files:
index.html— page structuregame.js— game logicstyle.css— styling (optional)
Step 3: Write Your Game
Here’s a complete game in 40 lines — a clicker where you catch falling stars:
index.html:
<canvas id="game" width="800" height="600"></canvas>
<script type="module" src="game.js"></script>
game.js:
import sg from 'https://cdn.siliconghetto.com/engine/v0.1/sg.js';
await sg.init('game', 800, 600);
let score = 0;
const stars = [];
// Spawn a star at a random X position
function spawnStar() {
const star = sg.spawn({
x: Math.random() * 760 + 20,
y: -20,
sprite: { w: 16, h: 16, r: 1, g: 0.9, b: 0.2 },
collision: { w: 16, h: 16 },
});
stars.push(star);
}
// Player (controlled by mouse)
const player = sg.spawn({
x: 400, y: 550,
sprite: { w: 48, h: 16, r: 0.2, g: 0.6, b: 1 },
collision: { w: 48, h: 16 },
});
sg.run({
update() {
// Move player to mouse
sg.setPos(player, sg.mouseX, 550);
// Spawn stars periodically
if (sg.frame % 30 === 0) spawnStar();
// Move stars down + check catches
for (let i = stars.length - 1; i >= 0; i--) {
const s = stars[i];
sg.setPos(s, sg.getX(s), sg.getY(s) + 120 * sg.dt);
if (sg.checkCollision(player, s)) {
score++;
sg.despawn(s);
stars.splice(i, 1);
} else if (sg.getY(s) > 620) {
sg.despawn(s);
stars.splice(i, 1);
}
}
},
draw() {
sg.clear(0.08, 0.05, 0.15);
sg.drawAll();
sg.drawText(`Stars: ${score}`, 10, 10, 20, { r: 1, g: 0.9, b: 0.3 });
},
});
Step 4: Preview
Click the preview button to see your game running in real-time. The engine handles all GPU rendering — your code just defines the logic.
Step 5: Publish
Hit “Publish” and your game is instantly live at your-slug.siliconghetto.com. Share it with anyone — no downloads, no installs, just click and play.
What Just Happened?
In 40 lines you used:
sg.spawn()— created entities with position, size, color, and collision boxessg.setPos()/sg.getX()— moved things aroundsg.checkCollision()— detected when the player caught a starsg.drawAll()— rendered everything with GPU accelerationsg.drawText()— drew the score on screen
The engine compiled from Rust to WebAssembly. It detects WebGPU or falls back to WebGL2. Your game runs at 60fps on any browser.
Next Steps
- API Reference — every function documented
- Voxel Game Guide — build a 3D Minecraft-style world
- Platformer Demo — see a full 2D platformer
- Voxel Demo — see a full 3D sandbox