Hi Cyber,
There is a bug with INTstatement. There is a pixel difference of 16 pixeln!
Try the small demo in order to see what I mean.
If you click on the red wall, you will put another wall on it.
This happens with a difference of 16 pixel!
Look also at the (x/y position) and (mousex/mousey position). Move the mouse slow.
function Sprite(id,x,y,w,h,fx)
drawimage(w*fx,0,w,h,x,y,id)
end
function SetText(x,y,txt,r,g,b)
color(r,g,b)
drawtext(x,y,txt)
end
screen(320,240,0,"Ohh")
setframetimer(60)
backcolor(255,255,255)
x,y,z,b,s = 0,0,0,0,0
b=loadimage("png/brick1.png")
s=loadimage("png/xsteel.png")
repeat
key=getkey()
cls()
x= int(mousex()/32)
y= int(mousey()/32)
for z=0,10 do
Sprite(b,z*32,32,32,32,0)
end
if mouseb()==1 and y==1 then
Sprite(s,x*32,y*32,32,32,1)
end
SetText(0, 0,"x= "..x.." mousex "..mousex(),0,0,0)
SetText(0,12,"y= "..y.." mousey "..mousey(),0,0,0)
sync()
until key==27
closewindow()