check out my 20 line pacman entry the actual game isn't that good but it uses data to build th level out of 3d cubes here it is in an easy to read form
rem using data and read to make levels
rem sync etc
sync on
sync rate 40
hide mouse
rem setting up object variables
obj=1
obj2=500
obj3=1000
obj4=1500
x#=90
y#=-20
z#=0
score=0
w=0
lose=0
rem important stuff
rem starts off the for+next stuff
for y=1 to 20
for x=1 to 20
rem instructs program to read data at the end of proggy
read a
rem reads data and decides what to do with it
if a=5
make object sphere 2000,8
position object 2000,x*10,y*-10,0
make object collision box 2000,-3,-3,-3,3,3,3,0
color object 2000,rgb(255,255,0)
endif
if a=1
obj=obj+1
make object cube obj,10
position object obj,x*10,y*-10,0
color object obj,rgb(255,0,0)
make object collision box obj,-5,-5,-5,5,5,5,0
endif
if a=2
obj2=obj2+1
make object sphere obj2,2.5
position object obj2,x*10,y*-10,0
make object collision box obj2,-2.5,-2.5,-2.5,2.5,2.5,2.5,0
color object obj2,rgb(255,255,0)
w=w+1
endif
if a=4
obj4=obj4+1
make object sphere obj4,8
position object obj4,x*10,y*-10,0
set object collision to boxes obj4
color object obj4,rgb(0,180,0)
make object collision box obj4,-3,-3,-3,3,3,3,0
ghost object on obj4
endif
if a=3
obj3=obj3+1
make object sphere obj3,2.5
position object obj3,x*10,y*-10,0
make object collision box obj3,-2.5,-2.5,-2.5,2.5,2.5,2.5,0
color object obj3,rgb(255,180,0)
w=w+1
endif
rem finishes the for/next commands
next x
next y
rem colours the backdrop
color backdrop 0
do
for t=1501 to obj4
gx#=object position x(t)
gy#=object position y(t)
point object t,x#,y#,z#
move object t,2.2
if object collision(t,0)
if object collision(t,2000)
hide object 2000
lose=1
endif
position object t,gx#,gy#,0
if object collision(t,0)<1000 and object collision(t,0)>500
point object t,x#,y#,z#
move object t,2.2
endif
endif
next t
oldx#=object position x(2000)
oldy#=object position y(2000)
if rightkey()=1
x#=x#+2.5
position object 2000,x#,y#,z#
endif
if leftkey()=1
x#=x#-2.5
position object 2000,x#,y#,z#
endif
if downkey()=1
y#=y#-2.5
position object 2000,x#,y#,z#
endif
if upkey()=1
y#=y#+2.5
position object 2000,x#,y#,z#
endif
if object collision(2000,0)
if object collision(2000,0)>=500 and object collision(2000,0)<=obj3
rem magic dot stuff
remstart
if object collision(2000,0)>=obj2 and object collision(2000,0)<=obj3
color object 2000,rgb(255,0,0)
kill=1
endif
remend
score=score+1
delete object object collision(2000,0)
endif
position object 2000,oldx#,oldy#,0
endif
if score=w
center text 320,240,"You Win!!!"
endif
if lose=1
center text 320,240,"You Lose!!!"
endif
rem get player position and store in x# and z#
x#=object position x(2000)
z#=object position z(2000)
y#=object position y(2000)
rem position the camera
position camera curvevalue(x#,camera position x(),5),curvevalue(y#,camera position y(),5),-130
rem point camera at player
sync
loop
rem the data
rem 0=blank space
rem 1=red brick
rem 2=yellow dot
rem 3=orange dot
rem 4=ghost
rem 5=player start (only put 1)
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,5,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,2,1
data 1,0,1,1,0,1,1,2,0,0,0,1,1,1,0,1,1,1,0,1
data 1,0,1,0,0,0,0,0,1,1,4,1,1,1,0,1,0,1,0,1
data 1,0,1,0,1,1,1,1,1,1,0,0,0,0,0,0,2,0,0,1
data 1,0,0,0,0,0,0,0,0,1,2,1,1,0,1,1,1,0,1,1
data 1,0,1,1,1,1,0,1,1,1,0,1,1,0,1,1,1,0,1,1
data 1,0,0,0,2,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1
data 1,1,1,1,1,1,0,1,0,0,0,1,1,0,2,0,1,1,0,1
data 1,2,0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,0,1
data 1,1,0,1,1,1,0,1,1,0,0,0,2,1,0,4,0,0,0,1
data 1,1,0,0,0,0,0,1,1,0,1,1,1,1,0,1,1,0,1,1
data 1,1,1,1,1,0,1,1,1,4,1,1,0,1,0,0,0,0,0,1
data 1,0,1,1,1,0,1,1,1,0,0,0,0,1,0,1,1,1,0,1
data 1,0,0,0,0,0,1,0,0,0,1,0,1,1,0,1,1,1,0,1
data 1,0,1,1,1,0,1,1,1,0,1,0,1,1,0,2,0,0,0,1
data 1,0,1,1,0,0,0,0,0,0,0,0,1,1,0,1,1,1,4,1
data 1,2,1,1,0,1,0,1,1,0,1,0,2,0,0,0,0,2,0,1
data 1,0,0,4,0,1,0,0,2,0,1,1,1,1,1,1,1,1,1,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
it works quite well and can also be used to place the dots and ghosts on the level, it also determines where the player starts
ARE YOU A 3D MODELER??? IF SO WE NEED YOU!!!
EMAIL mynameisnoneofyourbuisness@hotmail.com to work on the new Star Strike project!!!