64 lines
1.4 KiB
Lua
64 lines
1.4 KiB
Lua
pico-8 cartridge // http://www.pico-8.com
|
|
version 43
|
|
__lua__
|
|
-- game main loop
|
|
|
|
game_state={
|
|
state = 1 -- 1: title 2: game 3: over
|
|
}
|
|
|
|
function _init()
|
|
end
|
|
|
|
function _update()
|
|
|
|
-- update game_objects
|
|
for object in all(game_objects) do
|
|
object:update()
|
|
end
|
|
end
|
|
|
|
function _draw()
|
|
|
|
-- draw game_objects
|
|
for object in all(game_objects) do
|
|
object:draw()
|
|
end
|
|
|
|
end
|
|
|
|
-->8
|
|
-- game objects
|
|
|
|
game_objects={}
|
|
|
|
|
|
|
|
--[[ template:
|
|
function make_object(_x,_y)
|
|
|
|
local object={
|
|
x=_x,
|
|
y=_y
|
|
}
|
|
|
|
function object:update()
|
|
end
|
|
|
|
function object:draw()
|
|
spr(1,x,y)
|
|
end
|
|
|
|
add(game_objects, object)
|
|
return object
|
|
end
|
|
--]]
|
|
|
|
__gfx__
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|