Tools updated
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
ind = 22
|
||||
function init()
|
||||
mode(2)
|
||||
map = {}
|
||||
@@ -7,7 +6,6 @@ function init()
|
||||
map[i] = 32
|
||||
col[i] = 0x0f
|
||||
end
|
||||
map[ind] = 65
|
||||
sel_col = 0x0f
|
||||
sel_chr = 65
|
||||
end
|
||||
@@ -76,10 +74,17 @@ function draw_map()
|
||||
map[mx+my*20] = sel_chr
|
||||
col[mx+my*20] = sel_col
|
||||
end
|
||||
if mousebutton(3) then
|
||||
col[mx+my*20] = sel_col
|
||||
end
|
||||
if btn(KEY_SPACE) then
|
||||
sel_chr = peek(mx+my*20)
|
||||
sel_col = peek(300+mx+my*20)
|
||||
end
|
||||
if btnp(KEY_UP) then for i=20,299 do map[i-20]=map[i]col[i-20]=col[i] end end
|
||||
if btnp(KEY_DOWN) then for i=279,0,-1 do map[i+20]=map[i]col[i+20]=col[i] end end
|
||||
if btnp(KEY_LEFT) then for i=0,298 do map[i]=map[i+1]col[i]=col[i+1] end end
|
||||
if btnp(KEY_RIGHT) then for i=299,1,-1 do map[i]=map[i-1]col[i]=col[i-1] end end
|
||||
|
||||
blink = blink - 1
|
||||
if blink < 30 then
|
||||
@@ -88,4 +93,15 @@ function draw_map()
|
||||
local c = peek(300+(mx+my*20))
|
||||
poke(300+(mx+my*20), c~0xff)
|
||||
end
|
||||
|
||||
if btn(KEY_S) then
|
||||
fileout("map.bin", 0, 600);
|
||||
elseif btn(KEY_L) then
|
||||
filein("map.bin", 0, 600);
|
||||
for i=0,299 do
|
||||
map[i] = peek(i)
|
||||
col[i] = peek(300+i)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user