Ive been working on a matrix making program
`setup
sync on
sync rate 0
set display mode 1024,768,16
set camera range 1,9999999999
backdrop on
color backdrop 0
hide mouse
sync
`create a texture
create bitmap 1,50,50
set current bitmap 1
ink rgb(0,255,0),0
for x=1 to 50 step 5
for y=1 to 50 step 5
dot x,y
next x
next y
get image 1,0,0,50,50
delete bitmap 1
set current bitmap 0
`create a matrix
landsize=10000
tilesx=70
tilesz=70
inten=10
make matrix 1,landsize,landsize,tilesx,tilesz
prepare matrix texture 1,1,1,1
update matrix 1
tilesizex=landsize/tilesx
tilesizez=landsize/tilesz
`create selectors
make object cube 1,25
make object cone 2,25
color object 1,rgb(255,0,0)
color object 2,rgb(0,0,255)
xrotate object 2,180 : fix object pivot 2
`modes
mode=1
`MAIN LOOP---
Do
`move red selector
a#=wrapvalue(a#+mousemovex())
yrotate object 1,a#
if upkey()=1
rx#=newxvalue(rx#,a#,10.0)
rz#=newzvalue(rz#,a#,10.0)
endif
if downkey()=1
rx#=newxvalue(rx#,a#,-10.0)
rz#=newzvalue(rz#,a#,-10.0)
endif
ry#=get ground height(1,rx#,rz#)
position object 1,rx#,ry#,rz#
`control camera
ca#=wrapvalue(curveangle(a#,ca#,10.0))
cax#=wrapvalue(cax#+mousemovey()*0.5)
camx#=wrapvalue(curveangle(cax#,camx#,10.0))
cx#=newxvalue(rx#,ca#,-300)
cz#=newzvalue(rz#,ca#,-300)
cy#=get ground height(1,cx#,cz#)+200
position camera cx#,cy#,cz#
rotate camera wrapvalue(camx#),wrapvalue(ca#),0
`control blue selector
tilex=(rx#/(int((landsize/tilesx))))
tilez=(rz#/(int((landsize/tilesz))))
tilex#=tilex*tilesizex
tilez#=tilez*tilesizez
by#=get ground height(1,tilex#,tilez#)+12.5
position object 2,tilex#,by#,tilez#
ontilex#=int(tilex#/tilesizex)
ontilez#=int(tilez#/tilesizez)
`change mode
if inkey$()="1" then mode=1
if inkey$()="2" then mode=2
if inkey$()="3" then mode=3
`change heights
if mouseclick()=1
inc h#,inten
endif
if mouseclick()=2
dec h#,inten
endif
if mouseclick()=0 then h#=0
if mode=1
mode$="Single Tiles"
if mouseclick()>0
set matrix height 1,ontilex#,ontilez#,h#
update matrix 1
endif
endif
if mode=2
mode$="Bunch of Tiles"
if mouseclick()>0
set matrix height 1,ontilex#,ontilez#,h#
set matrix height 1,ontilex#-1,ontilez#,h#/1.5
set matrix height 1,ontilex#+1,ontilez#,h#/1.5
set matrix height 1,ontilex#,ontilez#-1,h#/1.5
set matrix height 1,ontilex#,ontilez#+1,h#/1.5
set matrix height 1,ontilex#+1,ontilez#,h#/1.5
set matrix height 1,ontilex#-1,ontilez#,h#/1.5
set matrix height 1,ontilex#,ontilez#+1,h#/1.5
set matrix height 1,ontilex#,ontilez#-1,h#/1.5
set matrix height 1,ontilex#-1,ontilez#-1,h#/1.5
set matrix height 1,ontilex#+1,ontilez#+1,h#/1.5
update matrix 1
endif
endif
if mode=3
mode$="Scramble"
if mouseclick()>0
for x=1 to tilesx-1
for z=1 to tilesz-1
set matrix height 1,x,z,rnd(h#)
next x
next z
update matrix 1
endif
endif
if mode>0
if ontilex#>tilesx-1 then ontilex#=tilesx-1
if ontilez#<1 then ontilez#=1
if ontilex#<1 then ontilex#=1
if ontilez#>tilesz-1 then ontilez#=tilesz-1
endif
`UI
set text font "comic sans ms"
set text size 25
set text to bold
ink rgb(255,0,255),0
text 10,10,"Press 1, 2 or 3 for different modes."
text 10,30,"Press 1: Single Tiles"
text 10,45,"Press 2: Bunch of Tiles"
text 10,60,"Press 3: Scramble"
text 10,100,"Current mode: "+mode$
`save source code
`END LOOP---
sync
loop
so far ive made the actuall maker, and later i will make a gui at the beggining to change the matrix's setting, but at the moment I'm stuck.. I want it to write source code for it, now I understand that I would need to write all of it with data and stuff, but i just dont know whow to do it, any help appreciated
Your signature has been erased by a mod because it's larger than 600x120...