diff --git a/main.lua b/main.lua index d7ed858..6ed16f5 100644 --- a/main.lua +++ b/main.lua @@ -4,32 +4,16 @@ require("generated/filter-types") require("generated/assets") require("generated/all-systems") -local world = require("world") +local scenarios = require("scenarios") -local scenarios = { - default = function() - -- TODO: Add default entities - end, - textTestScenario = function() - world:addEntity({ - position = { x = 0, y = 600 }, - drawAsText = { - text = "Hello, world!", - style = TextStyle.Inverted, - }, - velocity = { x = 240, y = -500 }, - mass = 1, - decayAfterSeconds = 10, - }) - end, -} +local world = require("world") local currentScenario = scenarios.textTestScenario local freeze = false local delta function love.load() - currentScenario() + currentScenario(world) love.graphics.setBackgroundColor(1, 1, 1) love.graphics.setFont(EtBt7001Z0xa(32)) end @@ -39,7 +23,7 @@ function love.update(dt) if love.keyboard.isDown("r") then world:clearEntities() - currentScenario() + currentScenario(world) freeze = false end diff --git a/scenarios.lua b/scenarios.lua new file mode 100644 index 0000000..d8bf28a --- /dev/null +++ b/scenarios.lua @@ -0,0 +1,22 @@ +local scenarios = {} + +---@param world World +function scenarios.default(world) + -- TODO: Add default entities +end + +---@param world World +function scenarios.textTestScenario(world) + world:addEntity({ + position = { x = 0, y = 600 }, + drawAsText = { + text = "Hello, world!", + style = TextStyle.Inverted, + }, + velocity = { x = 240, y = -500 }, + mass = 1, + decayAfterSeconds = 10, + }) +end + +return scenarios