I'll try it without the code tag.
set display mode 800,600,16
hide mouse
sync on
sync rate 60
autocam off
set ambient light 60
set text font "stomp_squealer"
set text size 30
`load image "tex.bmp",101
`load image "cursor.bmp",102
`make object menu
make object sphere 50001,10
make object cube 50002,10
make object cone 50003,10
make object cylinder 50004,10:set object cull 50004,0
make object plain 50005,10,10
`load object "wedge.x",50006
`load object "pyramid.x",50007
for z=50001 to 50005
position object z,180,(z-50000)*20,250
texture object z,101
lock object on z
disable object zdepth z
next z
`mouse
make object plain 51000,5,5
texture object 51000,102
ghost object on 51000
lock object on 51000
disable object zdepth 51000
set object ambient 51000,0
`matrix height changer
make object cone 51001,10
set object cull 51001,0
texture object 51001,101
xrotate object 51001,180
fog on
m#=0
mode=2
click=0
matrix=0
cx#=0
cy#=0
image=0
keyp=0
oob=0
cli=0
objects=0
tilenum=0
roundmat=0
radius=0
scale=50
roundmat=10
radius=10
obang=45
printy=0
word$=""
`arrays
dim c(21)
`textures
dim image$(1000)
`matrix arrays
dim matghost(100)
dim mattilesx(100)
dim mattilesz(100)
dim matsizex(100)
dim matsizez(100)
dim mattexnum(100)
dim mattexsizex(100)
dim mattexsizey(100)
dim mattiletex(100,50000,50000)
`object arrays
dim obghost(5000)
dim obsizex(5000)
dim obsizey(5000)
dim obsizez(5000)
dim obtexsizex(5000)
dim obtexsizey(5000)
dim obtype(5000)
dim obshape(5000)
dim obtexnum(5000)
color backdrop 0
gosub recam
do
if printy>0
printy=printy-1
set cursor 220,0
print word$
endif
`reposition camera
if controlkey() then gosub recam
ink rgb(0,0,200),0
if selob<>0 then text 110,0,"Object Type: "+str$(obtype(selob))
`menus
`matrix
ink rgb(200,200,c(1)),0:text 650,400,"Make Matrix"
ink rgb(200,200,c(2)),0:text 650,420,"Delete Matrix"
ink rgb(200,200,c(3)),0:text 650,440,"Move Matrix"
ink rgb(200,200,c(4)),0:text 650,460,"Set Matrix Tile"
ink rgb(200,200,c(5)),0:text 650,480,"Set Matrix Height"
ink rgb(200,200,c(6)),0:text 650,500,"Randomize Matrix"
ink rgb(200,200,c(7)),0:text 650,520,"Ghost Matrix"
`objects
ink rgb(c(8),c(8),200),0:text 10,20,"Move Object"
ink rgb(c(9),c(9),200),0:text 10,40,"Scale Object"
ink rgb(c(10),c(10),200),0:text 10,60,"Texture Object"
ink rgb(c(11),c(11),200),0:text 10,80,"Rotate Object"
ink rgb(c(12),c(12),200),0:text 10,100,"Ghost Object"
ink rgb(c(13),c(13),200),0:text 10,120,"Set Object Type"
ink rgb(c(14),c(14),200),0:text 10,140,"Scale Object Texture"
`other ops
ink rgb(200,c(15),200),0:text 10,200,"load image"
ink rgb(200,c(16),200),0:text 10,220,"Object Scale: "+str$(scale)
ink rgb(200,c(17),200),0:text 10,240,"Object Rotation Angle: "+str$(obang)
ink rgb(200,c(18),200),0:text 10,260,"Matrix Height Scale: "+str$(roundmat)
ink rgb(200,c(19),200),0:text 10,280,"Matrix Hill Radius: "+str$(radius)
ink rgb(c(20),200,c(20)),0:text 10,0,"Save"
ink rgb(c(21),200,c(21)),0:text 60,0,"Load"
`change mode
oclick=click
if mouseclick()<>0 then click=mouseclick() else click=0
if click=2 and oclick=0
mousemovex()=0:mousemovey()=0
if mode=1 then mode=2:moddy=0 else mode=1
endif
`rotate camera
cx#=cx#/1.4
cy#=cy#/1.4
rotate camera wrapvalue(camera angle x()+cx#),wrapvalue(camera angle y()+cy#),0
`move camera
m#=m#/1.02
if mode=1
cx#=cx#+mousemovey()
cy#=cy#+mousemovex()
if mouseclick()=1 then m#=m#+.2
move camera m#
position mouse 400,300
else
`texture matrix tiles
if moddy=7
mtxx=mtxx+mousemovex()
mtzz=mtzz-mousemovey()
if mtxx>6 then mtxx=0:mtx=mtx+1
if mtxx<-6 then mtxx=0:mtx=mtx-1
if mtzz>6 then mtzz=0:mtz=mtz+1
if mtzz<-6 then mtzz=0:mtz=mtz-1
if mtx>mattilesx(selmat)-1 then mtx=mattilesx(selmat)-1
if mtz>mattilesz(selmat)-1 then mtz=mattilesz(selmat)-1
if mtx<0 then mtx=0
if mtz<0 then mtz=0
position object 51001,matrix position x(selmat)+(matsizex(selmat)/mattilesx(selmat))*mtx,get matrix height(selmat,mtx,mtz)+10,matrix position z(selmat)+(matsizez(selmat)/mattilesz(selmat))*mtz
position mouse 400,300
mousemovex()=0
mousemovey()=0
if mouseclick() then set matrix tile selmat,mtx,mtz,tilenum:mattiletex(selmat,mtx,mtz)=tilenum:update matrix selmat
endif
`move thing
if moddy=2
if mouseclick()<>1
mtxx=mtxx+mousemovex()
mtzz=mtzz-mousemovey()
if mtxx>6 then mtxx=0:mtx=mtx+1
if mtxx<-6 then mtxx=0:mtx=mtx-1
if mtzz>6 then mtzz=0:mtz=mtz+1
if mtzz<-6 then mtzz=0:mtz=mtz-1
if mtx>mattilesx(selmat) then mtx=mattilesx(selmat)
if mtz>mattilesz(selmat) then mtz=mattilesz(selmat)
if mtx<0 then mtx=0
if mtz<0 then mtz=0
else
moveup=mousemovey()
mtzz=mtzz+moveup
if abs(mtzz)>6
mtzz=0
for z=radius*-1 to radius
for x=radius*-1 to radius
if abs(x)<>radius and abs(z)<>radius and mtx+x>=0 and mtz+z>=0 and mtx+x<=mattilesx(selmat) and mtz+z<=mattilesz(selmat)
set matrix height selmat,mtx+x,mtz+z,get matrix height(selmat,mtx+x,mtz+z)-(cos(x*20)+cos(z*20))*moveup*roundmat
printy=200:word$="Matrix Height: "+str$(get matrix height(selmat,mtx+x,mtz+z))
endif
next z
next x
endif
if moveup<>0 then update matrix selmat
endif
position object 51001,matrix position x(selmat)+(matsizex(selmat)/mattilesx(selmat))*mtx,get matrix height(selmat,mtx,mtz)+10,matrix position z(selmat)+(matsizez(selmat)/mattilesz(selmat))*mtz
position mouse 400,300
mousemovex()=0
mousemovey()=0
endif
`moddies
if upkey() or downkey() or leftkey() or rightkey() then keyp=keyp+1 else keyp=4
if keyp=10
keyp=0
if moddy=1
if shiftkey()=0
if upkey() then position matrix selmat,matrix position x(selmat),matrix position y(selmat),matrix position z(selmat)+5
if downkey() then position matrix selmat,matrix position x(selmat),matrix position y(selmat),matrix position z(selmat)-5
if rightkey() then position matrix selmat,matrix position x(selmat),matrix position y(selmat),matrix position z(selmat)+5
if leftkey() then position matrix selmat,matrix position x(selmat),matrix position y(selmat),matrix position z(selmat)-5
else
if upkey() then position matrix selmat,matrix position x(selmat),matrix position y(selmat)+5,matrix position z(selmat)
if downkey() then position matrix selmat,matrix position x(selmat),matrix position y(selmat)-5,matrix position z(selmat)
endif
if upkey() or downkey() or leftkey() or rightkey() then printy=200:word$="Matrix Position X: "+str$(matrix position x(selmat))+" Matrix Position Y: "+str$(matrix position y(selmat))+" Matrix Position Z: "+str$(matrix position z(selmat))
endif
if moddy=3
if shiftkey()=0
if upkey() then position object selob,object position x(selob),object position y(selob),object position z(selob)+5
if downkey() then position object selob,object position x(selob),object position y(selob),object position z(selob)-5
if rightkey() then position object selob,object position x(selob)+5,object position y(selob),object position z(selob)
if leftkey() then position object selob,object position x(selob)-5,object position y(selob),object position z(selob)
else
if upkey() then position object selob,object position x(selob),object position y(selob)+5,object position z(selob)
if downkey() then position object selob,object position x(selob),object position y(selob)-5,object position z(selob)
endif
if upkey() or downkey() or leftkey() or rightkey() then printy=200:word$="Object Position X: "+str$(object position x(selob))+" Object Position Y: "+str$(object position y(selob))+" Object Position Z: "+str$(object position z(selob))
endif
if moddy=4
if shiftkey()=0
if upkey() then obsizez(selob)=obsizez(selob)+scale
if downkey() then obsizez(selob)=obsizez(selob)-scale
if rightkey() then obsizex(selob)=obsizex(selob)+scale
if leftkey() then obsizex(selob)=obsizex(selob)-scale
else
if upkey() then obsizey(selob)=obsizey(selob)+scale
if downkey() then obsizey(selob)=obsizey(selob)-scale
endif
scale object selob,obsizex(selob),obsizey(selob),obsizez(selob)
if upkey() or downkey() or leftkey() or rightkey() then printy=200:word$="Object Size X: "+str$(obsizex(selob))+" Object Size Y: "+str$(obsizey(selob))+" Object Size Z: "+str$(obsizez(selob))
endif
if moddy=5
if shiftkey()=0
if upkey() then xrotate object selob,object angle x(selob)+obang
if downkey() then xrotate object selob,object angle x(selob)+obang
if rightkey() then yrotate object selob,object angle y(selob)+obang
if leftkey() then yrotate object selob,object angle y(selob)+obang
else
if upkey() then zrotate object selob,object angle z(selob)+obang
if downkey() then zrotate object selob,object angle z(selob)+obang
endif
if upkey() or downkey() or leftkey() or rightkey() then printy=200:word$="Object Angle X: "+str$(object angle x(selob))+" Object Angle Y: "+str$(object angle y(selob))+" Object Angle Z: "+str$(object angle z(selob))
endif
if moddy=8
if upkey() then scale object texture selob,1,2:obtexsizey(selob)=obtexsizey(selob)+1
if downkey() then scale object texture selob,1,.5:obtexsizey(selob)=obtexsizey(selob)-1
if rightkey() then scale object texture selob,2,1:obtexsizex(selob)=obtexsizex(selob)+1
if leftkey() then scale object texture selob,.5,1:obtexsizex(selob)=obtexsizex(selob)-1
if upkey() or downkey() or leftkey() or rightkey() then printy=200:word$="Texture Scale X: "+str$(obtexsizex(selob))+" Texture Scale Y: "+str$(obtexsizey(selob))
endif
endif
`Select from menu
sel=0
`matrix options
if mousey()>=400 and mousey()<420 and mousex()>=650 then c(1)=200:sel=1 else c(1)=0
`make matrix
if mousey()>=420 and mousey()<440 and mousex()>=650 then c(2)=200:sel=2 else c(2)=0
`delete matrix
if mousey()>=440 and mousey()<460 and mousex()>=650 then c(3)=200:sel=3 else c(3)=0
`move matrix
if mousey()>=460 and mousey()<480 and mousex()>=650 then c(4)=200:sel=4 else c(4)=0
`texture matrix
if mousey()>=480 and mousey()<500 and mousex()>=650 then c(5)=200:sel=5 else c(5)=0
`set matrix height
if mousey()>=500 and mousey()<520 and mousex()>=650 then c(6)=200:sel=6 else c(6)=0
`rantomize matrix
if mousey()>=520 and mousey()<540 and mousex()>=650 then c(7)=200:sel=7 else c(7)=0
`ghost matrix
`object options
if mousey()>=20 and mousey()<40 and mousex()<=195 then c(8)=200:sel=8 else c(8)=0
`move object
if mousey()>=40 and mousey()<60 and mousex()<=195 then c(9)=200:sel=9 else c(9)=0
`scale object
if mousey()>=60 and mousey()<80 and mousex()<=195 then c(10)=200:sel=10 else c(10)=0
`texture object
if mousey()>=80 and mousey()<100 and mousex()<=195 then c(11)=200:sel=11 else c(11)=0
`rotate object
if mousey()>=100 and mousey()<120 and mousex()<=195 then c(12)=200:sel=12 else c(12)=0
`ghost object
if mousey()>=120 and mousey()<140 and mousex()<=195 then c(13)=200:sel=13 else c(13)=0
`set object type
if mousey()>=140 and mousey()<160 and mousex()<=195 then c(14)=200:sel=14 else c(14)=0
`scale object texture
`other options
if mousey()>=200 and mousey()<220 and mousex()<=195 then c(15)=200:sel=15 else c(15)=0
``load image
if mousey()>=220 and mousey()<240 and mousex()<=195 then c(16)=200:sel=16 else c(16)=0
`object scale
if mousey()>=240 and mousey()<260 and mousex()<=195 then c(17)=200:sel=17 else c(17)=0
`object rotation angle
if mousey()>=260 and mousey()<280 and mousex()<=195 then c(18)=200:sel=18 else c(18)=0
`matrix height scale
if mousey()>=280 and mousey()<300 and mousex()<=195 then c(19)=200:sel=19 else c(19)=0
`matrix hill radius
if mousey()>=0 and mousey()<20 and mousex()<60 then c(20)=200:sel=20 else c(20)=0
`save
if mousey()>=0 and mousey()<20 and mousex()>=60 and mousex()<=100 then c(21)=200:sel=21 else c(21)=0
`load
if click=1 and oclick=0
mousemovex()=0:mousemovey()=0
if sel=20 then gosub save
`make matrix
if sel=1
print$="Matrix Width: ":gosub inpudding:mx#=val(val$)
print$="Matrix Height: ":gosub inpudding:mz#=val(val$)
print$="Matrix Tiles X: ":gosub inpudding:tx=val(val$)
print$="Matrix Tiles Z: ":gosub inpudding:tz=val(val$)
print$="Texture Number: ":gosub inpudding:txu=val(val$)
print$="Texture Size X: ":gosub inpudding:tsx=val(val$)
print$="Texture Size Y: ":gosub inpudding:tsy=val(val$)
matrix=matrix+1
make matrix matrix,mx#,mz#,tx,tz
if image exist(txu) then prepare matrix texture matrix,txu,tsx,tsy
mattilesx(matrix)=tx
mattilesz(matrix)=tz
matsizex(matrix)=mx#
matsizez(matrix)=mz#
mattexnum(matrix)=txu
mattexsizex(matrix)=tsx
mattexsizey(matrix)=tsy
selmat=matrix
mtx=0
mtz=0
mtxx=0
mtzz=0
endif
`delete matrix
if sel=2 then delete matrix selmat
`move matrix
if sel=3 then moddy=1
`texture matrix
if sel=4
print$="Texture Tile Number: ":gosub inpudding
tilenum=val(val$)
moddy=7
endif
`set matrix height
if sel=5 then moddy=2
`randomize matrix
if sel=6
print$="Maximum Height: ":gosub inpudding
randomize matrix selmat,val(val$)
update matrix selmat
endif
`ghost matrix
if sel=7
if matghost(selmat)=1 then matghost(selmat)=0:ghost matrix off selmat else matghost(selmat)=1:ghost matrix on selmat
endif
`move object
if sel=8 then moddy=3
`scale object
if sel=9 then moddy=4
`texture object
if sel=10
print$="Texture Number: ":gosub inpudding
texture object selob,val(val$)
obtexsizex(selob)=1
obtexsizey(selob)=1
obtexnum(selob)=val(val$)
endif
`rotate object
if sel=11 then moddy=5
`ghost object
if sel=12
if obghost(selob)=1 then obghost(selob)=0:ghost object off selob else obghost(selob)=1:ghost object on selob
endif
`set object type
if sel=13
print$="Object Type: ":gosub inpudding
obtype(selob)=val(val$)
endif
``load image
if sel=15
image=image+1
print$="`load image "+str$(image)+": ":gosub inpudding
if file exist(val$)
`load image val$,image
image$(image)=val$
endif
endif
`object scale
if sel=16
print$="Object Scale: ":gosub inpudding
scale=val(val$)
endif
`rotate object
if sel=17
print$="Object Rotation Angle: ":gosub inpudding
obang=val(val$)
endif
`matrix height scale
if sel=18
print$="Matrix Height Scale: ":gosub inpudding
roundmat=val(val$)
endif
`matrix hill radius
if sel=19
print$="Matrix Hill Radius: ":gosub inpudding
radius=val(val$)
endif
`scale object texture
if sel=14 then moddy=8
`load
if sel=21 then gosub load
endif
endif
position object 51000,(mousex()-390)/2,(mousey()-290)/-2,250
ooob=oob
oob=object collision(51000,0)
if oob>=50001 and oob<=50007 then scale object oob,200,200,200
if oob<>ooob and ooob<>0 then scale object ooob,100,100,100
ocli=cli
if mouseclick() then cli=mouseclick() else cli=0
if cli=1 and ocli=0
if oob>=50001 and oob<=50007
objects=objects+1
selob=objects
obshape(selob)=oob-50000
if oob=50001 then make object sphere objects,10
if oob=50002 then make object cube objects,10
if oob=50003 then make object cone objects,10
if oob=50004 then make object cylinder objects,10
if oob=50005 then make object plain objects,10,10
`if oob=50006 then load object "wedge.x",objects
`if oob=50007 then load object "pyramid.x",objects
obsizex(objects)=100
obsizey(objects)=100
obsizez(objects)=100
endif
endif
position object 51000,(mousex()-390)/4,(mousey()-290)/-4,125
sync
loop
`reposition camera
recam:
position camera 0,150,-200
rotate camera 45,0,0
return
`input
inpudding:
back=0
clear entry buffer
val$=""
inky=0
repeat
oback=back
if keystate(14) then back=1 else back=0
if back=1 and oback=0 then val$=left$(val$,len(val$)-1)
if keystate(14)=0 then val$=val$+entry$()
clear entry buffer
inky=wrapvalue(inky+5)
ink rgb(0,0,cos(inky)*20+200),0
set cursor 0,0:print print$
set cursor text width(print$),0:print val$
sync
until returnkey()
repeat:until scancode()=0
return
save:
print$="World Name: ":gosub inpudding
if file exist(val$+".wld") then delete file val$+".wld"
if file exist(val$+".mtx") then delete file val$+".mtx"
if file exist(val$+".tmg") then delete file val$+".tmg"
open to write 1,val$+".tmg"
if image<>0
write byte 1,1
for a1=1 to image
write string 1,image$(a1)
next a1
else
write byte 1,0
endif
close file 1
open to write 1,val$+".wld"
write long 1,objects
if objects<>0
for a1=1 to objects
write byte 1,obshape(a1)
write byte 1,obghost(a1)
write long 1,obsizex(a1)
write long 1,obsizey(a1)
write long 1,obsizez(a1)
write byte 1,obtexsizex(a1)
write byte 1,obtexsizey(a1)
write byte 1,obtype(a1)
write long 1,object angle x(a1)
write long 1,object angle y(a1)
write long 1,object angle z(a1)
write long 1,object position x(a1)
write long 1,object position y(a1)
write long 1,object position z(a1)
next a1
endif
close file 1
open to write 1,val$+".mtx"
write long 1,matrix
if matrix<>0
for a1=1 to matrix
write byte 1,matghost(a1)
write long 1,mattilesx(a1)
write long 1,mattilesz(a1)
write long 1,matsizex(a1)
write long 1,matsizez(a1)
for z=0 to mattilesx(a1)
for x=0 to mattilesz(a1)
write long 1,get matrix height(a1,x,z)
write byte 1,mattiletex(a1,x,z)
next z
next x
write byte 1,mattexnum(a1)
write byte 1,mattexsizex(a1)
write byte 1,mattexsizey(a1)
write long 1,matrix position x(a1)
write long 1,matrix position y(a1)
write long 1,matrix position z(a1)
next a1
endif
close file 1
return
load:
print$="World Name: ":gosub inpudding
if objects<>0
for a1=1 to objects
delete object a1
next a1
endif
if matrix<>0
for a1=1 to matrix
delete matrix a1
next a1
endif
if image<>0
for a1=1 to image
delete image a1
next a1
endif
open to read 1,val$+".tmg"
read byte 1,image
if image<>0
for a1=1 to image
read string 1,image$(a1)
`load image image$(a1),a1
next a1
endif
close file 1
if file exist(val$+".wld")
open to read 1,val$+".wld"
read long 1,objects
if objects<>0
for a1=1 to objects
read byte 1,obshape(a1)
read byte 1,obghost(a1)
read long 1,obsizex(a1)
read long 1,obsizey(a1)
read long 1,obsizez(a1)
read byte 1,obtexsizex(a1)
read byte 1,obtexsizey(a1)
read byte 1,obtype(a1)
read long 1,obangx
read long 1,obangy
read long 1,obangz
read long 1,obposx
read long 1,obposy
read long 1,obposz
if obshape(a1)=1 then make object sphere objects,a1:scale object a1,obsizex(a1),obsizey(a1),obsizez(a1)
if obshape(a1)=2 then make object box objects,obsizex(a1)/10,obsizey(a1)/10,obsizez(a1)/10
if obshape(a1)=3 then make object cone objects,a1:scale object a1,obsizex(a1),obsizey(a1),obsizez(a1)
if obshape(a1)=4 then make object cylinder objects,a1:scale object a1,obsizex(a1),obsizey(a1),obsizez(a1)
if obshape(a1)=5 then make object plain objects,obsizex(a1),obsizey(a1)
if obshape(a1)=6 then load object "wedge.x",objects:scale object a1,obsizex(a1),obsizey(a1),obsizez(a1)
if obshape(a1)=7 then load object "pyramid.x",objects:scale object a1,obsizex(a1),obsizey(a1),obsizez(a1)
if obghost(a1)=1 then ghost object on a1
rotate object a1,obangx,obangy,obangz
position object a1,obposx,obposy,obposz
next a1
close file 1
endif
endif
if file exist(val$+".mtx")
if matrix<>0
open to read 1,val$+".mtx"
read long 1,matrix
for a1=1 to matrix
read byte 1,matghost(a1)
read long 1,mattilesx(a1)
read long 1,mattilesz(a1)
read long 1,matsizex(a1)
read long 1,matsizez(a1)
for z=0 to mattilesx(a1)
for x=0 to mattilesz(a1)
read long 1,matheight
read byte 1,mattiletex(a1,x,z)
set matrix height a1,x,z,matheight
set matrix tile a1,x,z,mattiletex(a1,x,z)
next z
next x
read byte 1,mattexnum(a1)
read byte 1,mattexsizex(a1)
read byte 1,mattexsizey(a1)
read long 1,matposx
read long 1,matposy
read long 1,matposz
make matrix a1,matsizex(a1),matsizez(a1),mattilesx(a1),mattilesz(a1)
if mattexnum(a1)<>0
prepare matrix texture a1,mattexnum(a1),mattexsizex(a1),mattexsizey(a1)
endif
if matghost(a1)=1 then ghost matrix on a1
position matrix a1,matposx,matposy,matposz
next a1
close file 1
endif
endif
return