I know that the
POINT command could be too slow if we try to make something big, but it works even as a collision system for our levels using arrays or memblocks ...an example:
ink rgb(255,255,255),0
box 2,2,98,98
ink 0
box 20,20,80,80
ink rgb(255,255,255),0
box 22,22,78,80
get image 1,0,0,100,100,1
autocam off
sync on
dim Mapa(100,100)
paste image 1,0,0
lock pixels
for x=0 to 100
for y=0 to 100
Mapa(x,y)=point(x,100-y)
next y
next x
unlock pixels
make object box 1,4,10,2
position object 1,10,5,10
color object 1,rgb(255,0,0)
make object box 2,100,0,100
texture object 2,1
position object 2,50,0,50
position camera -20,40,-20
point camera 20,0,0
x#=10
z#=10
do
set cursor 0,0
print screen fps()
oldx#=x#
oldz#=z#
if upkey()=1 THEN x#=NEWXVALUE(x#,gira#,0.1):z#=NEWZVALUE(z#,gira#,0.1)
if downkey()=1 THEN x#=NEWXVALUE(x#,gira#,-0.1):z#=NEWZVALUE(z#,gira#,-0.1)
position object 1,x#,1,z#
yrotate object 1,gira#
if leftkey() then gira#=gira#-0.5
if rightkey() then gira#=gira#+0.5
x=object position x(1)
y=object position z(1)
rem map collision
if mapa(x,y+1)=0 then z#=oldz#
if mapa(x,y-1)=0 then z#=oldz#
if mapa(x+1,y)=0 then x#=oldx#
if mapa(x-1,y)=0 then x#=oldx#
point camera object position x(1),object position y(1),object position z(1)
sync
loop
Cheers.
I'm not a grumpy grandpa
