this is a rudimentary throw together of an idea for a platformer type game. code not cleaned up at all.
sync on : sync rate 60 : randomize timer()
set camera range 1,1000
bloksiz = 20
for i = 1 to 100
make object cube i,bloksiz
color object i,rgb(rnd(255),rnd(255),rnd(255))
read y
position object i,i*bloksiz,y,0
scale object i,100,rnd(45)+100,300
`rotate object i,0,0,rnd(15)-15
objx#=object position x(i)
objy#=object position y(i)
objz#=object position z(i)
objsx#=object size x(i)/2.0
objsy#=object size y(i)/2.0
objsz#=object size z(i)/2.0
make static collision box objx#-objsx#,objy#-objsy#,objz#-objsz#,objx#+objsx#,objy#+objsy#,objz#+objsz#
next i
scale object 1,100,500,100
scale object 100,100,500,100
rem player cube
make object cube 501,5
position object 501,50,10,0
rotate object 501,0,90,0
make object collision box 501,-2.5,-2.5,-2.5,2.5,2.5,2.5,0
rem Set a size for the player object
s#=object size y(501)/2.0
position camera 50,20,-40
point camera 50,0,0
make object plain 5000,5000,1000
position object 5000,2500,0,100
scale object 5000,1,10,100
rotate object 5000,0,180,0
color object 5000,rgb(25,25,255)
disable escapekey : while escapekey()=0
rem Store old positions
oldposx#=object position x(501)
oldposy#=object position y(501)
oldposz#=object position z(501)
if leftkey()=1
move object 501,-1
endif
if rightkey()=1
move object 501,1
endif
rem Get current object position
posx#=object position x(501)
posy#=object position y(501)
posz#=object position z(501)
rem Handle a touch of gravity
playergrav#=playergrav#-0.02
posy#=posy#+playergrav#
rem Handle sliding collision for player object with other objects
position object 501,posx#,posy#,posz#
if object collision(501,0)>0
dec posx#,get object collision x()
dec posy#,get object collision y()
dec posz#,get object collision z()
playergrav#=0.5
endif
position camera object position x(501),object position y(501)+15,object position z(501)-75
point camera object position x(501),object position y(501),object position z(501)
sync : endwhile
for i = 1 to 100
delete object i
next i
delete object 501
end
data 0,1,1,3,3,6,6,6,2,2
data 2,2,5,7,9,15,16,17,18,19
data 20,19,18,6,5,4,3,2,1,0
data 2,4,6,8,10,12,14,16,18,9
data 10,11,12,13,14,15,16,17,18,19
data 20,19,18,6,5,4,3,2,1,0
data 3,6,9,12,15,18,21,24,27,30
data 10,11,12,13,14,15,16,17,18,19
data 20,19,18,6,5,4,3,2,1,0
data 0,1,2,3,4,5,6,7,8,9
fall down seven times, stand up eight