Back to Lab

Creating Levels

docs/developers/creating_levels.md

latest1.1 KB
Original Source

Creating Levels

Levels are Lua scripts loaded from the game_scripts/levels directory.

Design Pattern

All logic is put into a factory in game_scripts/factories. That factory is then instantiated with a small, data-only script.

For example, game_scripts/levels/lt_horseshoe_color.lua instantiates the logic in assets/games_scripts/factories/lt_factory.lua with botCount = 4.

lua
local factory = require 'factories.lt_factory'

return factory.createLevelApi{
    mapName = 'lt_horseshoe_color',
    color = true,
    botCount = 4,
    camera = {-50, 450, 900},
}

Tutorial

A narrative tutorial walks through the initial steps in creating a simple level.

Details