load image "grass.bmp",2
load image "tree edge.bmp",1
make matrix 1, 150,150,50, 50
randomize matrix 1, 10
for x=1 to 50
set matrix height 1,x,0,0
set matrix height 1,x,50,0
next x
for z=1 to 50
set matrix height 1,0,z,0
set matrix height 1,50,z,0
next z
for a=1 to 2
for x=1 to ((50)-1)
for z=1 to ((50)-1)
set matrix height 1,x,z,(get matrix height(1,x-1,z)+get matrix height(1,x+1,z)+get matrix height(1,x,z-1)+get matrix height(1,x,z+1))/4
next z
next x
for x=1 to 50
set matrix height 1,x,0,0
set matrix height 1,x,50,0
next x
for z=1 to 50
set matrix height 1,0,z,0
set matrix height 1,50,z,0
next z
next a
sync on
make object sphere 5, 3
make object plain 1, 150,50
make object plain 2, 150,50
make object plain 3,150,50
make object plain 4,150,50
position object 1,75,25,0
position object 2,75,25,150
position object 3,0,25,75
yrotate object 3,90
yrotate object 4,90
position object 4,150,25,75
for a=1 to 4
texture object a,1
next a
update matrix 1
position camera 0,0,0,0
do
x# = object position x(5)
y# = get ground height(1,x#,z#)+1.5
z# = object position z(5)
position object 5,x#,y#,z#
position camera object position x(5),object position y(5), object position z(5)
yrotate camera object angle y(5)
if upkey()=1 then move object 5,.3
if downkey()=1 then move object 5,-.1
if leftkey()=1 then yrotate object 5, object angle y(5)-3
if rightkey()=1 then yrotate object 5, object angle y(5)+3
print x#
print z#
sync
loop
I'm using it for a game i'm making called.....
(play this piece of code for cool title XD)
for a=40 to 50
set text size a
text screen height()/3-a/2, screen width()/3+a/2,"Forest Wars"
next a
wait 3000
objects 1-4 are the boundaries, the matrix is the matrix, and the ball is ur character. I have him moving over pretty nicely, but how do i....
1. make a gun appear in bottom right corner (just a box)
2. randomly place patches of trees (so that its not just a giant forest, and so that it looks nicer)
3. texture the matrix using grass.bmp
parrot