OK it's not exactly the same but it has the same problems.
randomize matrix 1,2 will hardly make any difference to the height.
Quote: "
I made some changes to your code:
You didn't update your matrix so the randomized heights never displayed on screen. I've added this.
I increased the RANDOMIZE MATRIX for bigger "hills".
I removed CaY# because it was never used.
I've made the program read the height of the cube's position in the matrix and it now repositions it to that height.
Removed the mouseclick, wasn't exciting just delayed the program.
Changed the camera follow parameters.
"
make matrix 1,4000,4000,30,30
randomize matrix 1,50
update matrix 1
make object box 1,24,16,20
d#=250.0 : s#=10.0 : `these never change so can go before the main loop
sync on : `manual screen refresh on
DO
if spacekey()=1 then move object 1,20
if controlkey()=1 then move object 1,40
if shiftkey()=1 then move object 1,30
if upkey()=1 then move object 1,10
if downkey()=1 then move object 1,5
if leftkey()=1 then yrotate object 1,wrapvalue(object angle y(1)-8) : walk=1
if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+8)
x#=object position x(1):z#=object position z(1):a#=object angle y(1)
x = x# : z = z# : `convert to integers (get ground height doesn't like reals)
y# = get ground height(1,x,z) + object size y(1)/2 : `place object at floor height, move up so that bottom of box is on floor
h# = y# + 20 : `adjust camera height to new box height
position object 1,x#,y#,z# : `update object position
set camera to follow x#,y#,z#,a#,d#,h#,s#,1
sync : `refresh screen
loop
What do you mean "code for a gun barrel"?
I don't understand why a gun barrel would change the matrix, maybe this is part of not having the UPDATE MATRIX command.
To make a texture for a matrix you first make the texture then lookup PREPARE MATRIX TEXTURE in the help file.
I am King of the noobs!
