generated from sage/tiny-ecs-love-template
40 lines
866 B
Lua
40 lines
866 B
Lua
require("tiny-debug")
|
|
tiny = require("lib/tiny")
|
|
require("utils")
|
|
require("tiny-tools")
|
|
|
|
World = tiny.world()
|
|
|
|
require("generated/filter-types")
|
|
require("generated/assets")
|
|
require("generated/all-systems")
|
|
|
|
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,
|
|
}
|
|
|
|
scenarios.textTestScenario()
|
|
|
|
function love.load()
|
|
love.graphics.setBackgroundColor(1, 1, 1)
|
|
love.graphics.setFont(EtBt7001Z0xa(32))
|
|
end
|
|
|
|
function love.draw()
|
|
World:update(love.timer.getDelta())
|
|
end
|