Your First Game
This guide walks through creating a simple game on Krunker from concept to playable prototype.
Start With a Concept
Before opening the editor, decide on a basic game idea. Keep it simple:
- A target shooting gallery
- A parkour obstacle course
- A collect-the-items game
- A tag or hide-and-seek game
Don't try to build everything at once. Start with the core mechanic and expand from there.
Create Your Scene
Open the Krunker Editor and select "Quick Start" or choose a template that fits your concept.
The editor provides:
- 3D object placement - cubes, ramps, planes, and custom assets
- Object properties - position, scale, rotation, color, collision
- Script editor - client and server KrunkScript panels
- Live preview - test your game instantly in the editor
See the Scene Composition guide for details on building scenes.
Add Game Logic
Open the script editor and add your game logic. Here's a minimal example that tracks score when players interact with objects:
Server script:
num score = 0;
public action onPlayerSpawn(str id) {
obj player = GAME.PLAYERS.findByID(id);
if (!!player) {
player.score = 0;
};
}
public action onNetworkMessage(str id, obj data, str playerID) {
if (id == "score") {
obj player = GAME.PLAYERS.findByID(playerID);
if (!!player) {
(num) player.score += 1;
GAME.NETWORK.send("updateScore", {s: (num) player.score}, playerID);
};
};
}
Client script:
public action onNetworkMessage(str id, obj data) {
if (id == "updateScore") {
GAME.UI.updateDIVText("scoreDisplay", "Score: " + toStr (num) data.s);
};
}
See the Game Logic guide for detailed coverage of timing, players, inputs, and AI.
Test and Iterate
Use the editor's play button to test your game. The iterative process is:
- Play - test the current state
- Identify - find what feels wrong or missing
- Adjust - make small, targeted changes
- Repeat - test again
Focus on getting the core mechanic feeling right before adding polish, UI, or extra features.
Next Steps
Once your basic game works:
- Add custom UI for score displays and menus
- Implement multiplayer networking for real-time interaction
- Use data storage for persistent player progress
- Create resource packs for custom assets and styling
- Set up video ads for monetization