switches implemented
This commit is contained in:
14
main.lua
14
main.lua
@@ -57,7 +57,7 @@ function _update()
|
||||
|
||||
if mode==modes.editing then
|
||||
draw_hab(abad.hab,0,0,true)
|
||||
text(abad.hab,100,10,2)
|
||||
text(abad.hab,120,1,2)
|
||||
|
||||
sspr(0,64,128,48,0,48)
|
||||
color(3)
|
||||
@@ -84,6 +84,11 @@ function _update()
|
||||
end
|
||||
|
||||
local mx,my=mousex(),mousey()
|
||||
if mx>>3 < 12 and my>>3 < 6 then
|
||||
text(mx>>3,100,10,2)
|
||||
text(my>>3,111,10,2)
|
||||
text((mx>>3)+(my>>3)*12,118,10,2)
|
||||
end
|
||||
if mbtn(1) then
|
||||
if my>=48 then
|
||||
seltile=(mx>>3)+((my-48)>>3)*16
|
||||
@@ -95,6 +100,10 @@ function _update()
|
||||
mapa_set_tile(abad.hab,mx>>3,my>>3,255)
|
||||
end
|
||||
end
|
||||
if mx>>3 < 12 and my>>3 < 6 then
|
||||
local tx,ty=(mx>>3)<<3,(my>>3)<<3
|
||||
rect(tx,ty,tx+8,ty+8,3)
|
||||
end
|
||||
else
|
||||
draw_hab(abad.hab,0,0)
|
||||
text(abad.hab,1,1,2)
|
||||
@@ -114,7 +123,8 @@ function _update()
|
||||
end
|
||||
end
|
||||
cacau.update()
|
||||
|
||||
switches.update()
|
||||
|
||||
if btnp(KEY_RETURN) then
|
||||
mode=modes.editing
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user