Why O Why does the point command do what is says it is supposed to do.
Please replace the two media jpg files with your own textures.
cls
set display mode 640,480,32
show mouse
autocam off
sync rate 1000
load image "floor2.jpg",1
load image "floor.jpg",2
color backdrop 23465435
backdrop on
draw to front
y = 50
x = 400
y2 = 1
x2 = 200
up = 0
right = 0
up2 = 0
right2 = 0
do
sprite 1,x,y,1
sprite 2,x2,y2,2
gosub moveboxes
if mouseclick() then gosub dis
gosub hit
set cursor 0,0
print leftside,rightside,topmid,botmid
set cursor 0,20
print leftside2,rightside2,topmid2,botmid2
sync
loop
dis:
ink rgb(255,255,255),0
set cursor mousex()+20 , mousey()
print point (mousex()-2,mousey()-2)
return
hit:
`left mid
leftside = point(x - 2 ,y+sprite height(1)/2)
`right mid
rightside = point (sprite width(1) + 2 ,y + sprite height(1)/2)
` top mid
topmid = point (x + sprite width(1)/2 ,y - 2)
`bootom mid
botmid = point (x + sprite width(1)/2 ,y+sprite height(1)+2)
`left mid
leftside2 = point(x2 - 2 ,y2+sprite height(2)/2)
`right mid
rightside2 = point (sprite width(2) +2 ,y2+sprite height(2)/2)
` top mid
topmid2 = point (x2 + sprite width(2)/2 ,y2 - 2)
`bootom mid
botmid2 = point (x2 + sprite width(2)/2 ,y2+sprite height(2)+2)
return
moveboxes:
select up
case 0
y=y +1
if y >= 480-sprite height(1) then up = 1
endcase
case 1
y=y-1
if y = 640- sprite width(1) then right = 0
endcase
endselect
select up2
case 0
y2=y2 +1
if y2 >= 480 -sprite height(2) then up2 = 1
endcase
case 1
y2=y2-1
if y2 = 640 - sprite width(2) then right2 = 0
endcase
endselect
return
moveboxes:
select up
case 0
y=y +1
if y >= 480-sprite height(1) then up = 1
endcase
case 1
y=y-1
if y = 640- sprite width(1) then right = 0
endcase
endselect
select up2
case 0
y2=y2 +1
if y2 >= 480 -sprite height(2) then up2 = 1
endcase
case 1
y2=y2-1
if y2 = 640 - sprite width(2) then right2 = 0
endcase
endselect
return
}:>
Rich maybe you can shed some light on this.
The Universe has infinate possibilities. So do YOU!