28 lines
371 B
Lua
28 lines
371 B
Lua
|
player = {
|
||
|
x = nil,
|
||
|
y = nil
|
||
|
}
|
||
|
|
||
|
col_bg = 1
|
||
|
col_ground = 6
|
||
|
|
||
|
function _init()
|
||
|
for i=0,31 do
|
||
|
for j=0,31 do
|
||
|
if mget(i,j) == 5 then -- player id
|
||
|
player.x = i
|
||
|
player.y = j
|
||
|
break
|
||
|
end
|
||
|
end
|
||
|
if (player.x) break
|
||
|
end
|
||
|
print("player: ("..player.x..", "..player.y..")")
|
||
|
end
|
||
|
|
||
|
function _draw()
|
||
|
cls(col_bg)
|
||
|
rectfill(0, 135, 480, 270, col_ground)
|
||
|
-- map()
|
||
|
end
|