ind = 22 function init() setmode(2) map = {} col = {} for i=0,299 do map[i] = 32 col[i] = 0x0f end map[ind] = 65 sel_col = 0x0f sel_chr = 65 end blink=30 function update() if btn(KEY_TAB) then draw_picker() update_picker() else draw_map() --update_map() end end function draw_picker() for i=0,255 do poke(i, i) poke(300+i, sel_col) end for i=0,15 do poke(580+i, i<<4) poke(560+i, i<<4) poke(280+i, 32) poke(260+i, 32) end poke(580, 15) poke(560, 15) poke(260+(sel_col&0xf), 203) poke(280+(sel_col>>4), 203) local mx, my = mousex(), mousey() if my<13 then poke(300+(mx+my*20), 0x4e) print(mx+my*20, 16, 13) elseif my>=13 then poke(mx+my*20, 144) end end function update_picker() local mx, my = mousex(), mousey() if mousebutton(1) then if my<13 then sel_chr = mx+my*20 else if mx < 16 then if my == 13 then sel_col = (sel_col & 0xf0) + mx else sel_col = (sel_col & 0x0f) + (mx << 4) end end end end end function draw_map() for i=0,299 do poke(i, map[i]) poke(300+i, col[i]) end local mx, my = mousex(), mousey() if mousebutton(1) then map[mx+my*20] = sel_chr 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 blink = blink - 1 if blink < 30 then if blink==0 then blink = 60 end local mx, my = mousex(), mousey() local c = peek(300+(mx+my*20)) poke(300+(mx+my*20), c~0xff) end end