50 lines
1.2 KiB
Lua
50 lines
1.2 KiB
Lua
-- Escena 'joc' — gameplay.
|
|
--
|
|
-- PLACEHOLDER. La intencio es mantindre la mecanica fidel (pintar terra,
|
|
-- enemics que te perseguixen pel terra pintat, recarrega al pot) pero
|
|
-- amb tota la implementacio nova: moviment per delta time, FSM interna
|
|
-- per a fases / mort / fade-ins, etc.
|
|
--
|
|
-- Per ara nomes mostra que has entrat al joc i et deixa tornar al titol
|
|
-- amb ESC, per a poder provar la cadena d'escenes sense haver-ho fet
|
|
-- tot encara.
|
|
|
|
local M = {}
|
|
|
|
local manager, input
|
|
local temps = 0
|
|
|
|
function M.entra(servicis, _args)
|
|
manager = servicis.manager
|
|
input = servicis.input
|
|
temps = 0
|
|
end
|
|
|
|
function M.update(dt)
|
|
temps = temps + dt
|
|
if input.acaba_premuda("cancel") then
|
|
manager.canvia("titol")
|
|
end
|
|
end
|
|
|
|
function M.draw()
|
|
color(COLOR_WHITE, COLOR_BLACK)
|
|
cls()
|
|
|
|
color(COLOR_LIGHT_GREEN, COLOR_BLACK)
|
|
print("[ ESCENA JOC ]", 13, 4)
|
|
|
|
color(COLOR_LIGHT_GRAY, COLOR_BLACK)
|
|
print("Aci anira el gameplay DX.", 7, 10)
|
|
print("Pendent: motor de pintura,", 7, 12)
|
|
print("enemics, fases, FSM interna.", 7, 13)
|
|
|
|
color(COLOR_DARK_GRAY, COLOR_BLACK)
|
|
print("ESC = tornar al titol", 9, 22)
|
|
|
|
color(COLOR_DARK_GRAY, COLOR_BLACK)
|
|
print(string.format("temps: %.1fs", temps), 1, 28)
|
|
end
|
|
|
|
return M
|