wolf: move script to dedicated file
This commit is contained in:
parent
4a2a2c17e7
commit
0ba85c04db
2 changed files with 37 additions and 34 deletions
27
picotron/wolfenstein_src/main.lua
Normal file
27
picotron/wolfenstein_src/main.lua
Normal file
|
@ -0,0 +1,27 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue