Ok, here is what I have so far for my matrix and my character camera following. If you dont have the ninja just make a new object (ball) and replace my loading ninja with make object sphere 1
Ok here it is----------
`Ok see what you can do with this- its just a matrix and a ninja that walks
`if you have any problems post it on my topic at www.darkbasic.com
`If you dont have darkmatter then you may have to change some line around,
`like the ninja, just replace the ninja stuff with making a sphere and you
`may have to just delete my lines below load matrix music if you dont have it
`if that doesnt work just go into dark basic (im assuming you have the real
`version) and try out the tutorials. They really help with camera and matrix
`Please post on dark basic .com if this doesnt work or if you need any help
`with it. Im a beginner too, but it works for me in darkbasic so it should
`work for you! Just remember to remove this when you run the game....
rem load matrix music
load music "field.mid",3
Play music 3
loop music 3
Rem make matrix
Make matrix 1,10000,10000,20,20
Rem texture matrix
Load image "grass09.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
rem randomize the matrix
randomize matrix 1,225
rem Create character to follow
load object "H-Ninja-idle.x",1 : APPEND OBJECT "H-ninja-move.x",1,100
YROTATE OBJECT 1,180 : FIX OBJECT PIVOT 1
Scale object 1,5000,5000,5000
rem Loop 3D object animation from 0 to 20 (idle)
LOOP OBJECT 1,0,20 : SET OBJECT SPEED 1,1
rem Set variables for character position
x#=500
z#=500
rem Activate manual sync
sync on
rem Begin loop
do
rem Modify character angle based on left/right keys
stage=0
IF LEFTKEY()=1 THEN a#=a#-8.0
IF RIGHTKEY()=1 THEN a#=a#+8.0
a#=wrapvalue(a#)
rem Modify character position based on up/down keys
IF UPKEY()=1 THEN x#=NEWXVALUE(x#,a#,0.1) : z#=NEWZVALUE(z#,a#,0.1) : stage=1
IF DOWNKEY()=1 THEN x#=NEWXVALUE(x#,a#,-0.1) : z#=NEWZVALUE(z#,a#,0.1) : stage=1
rem If character action changes
IF stage<>oldstage
IF stage=0
SET OBJECT FRAME 1,0.0
LOOP OBJECT 1,0,250
SET OBJECT SPEED 1,10
ENDIF
IF stage=1
SET OBJECT FRAME 1,105.0
LOOP OBJECT 1,105,125
SET OBJECT SPEED 1,10
ENDIF
oldstage=stage
ENDIF
rem Update character position and angle
POSITION OBJECT 1,x#,0.0,z#
YROTATE OBJECT 1,a#
rem Control camera with arrow keys
if upkey()=1 then x#=newxvalue(x#,a#,5) : z#=newzvalue(z#,a#,5)
if downkey()=1 then x#=newxvalue(x#,a#,-5) : z#=newzvalue(z#,a#,-5)
if leftkey()=1 then a#=wrapvalue(a#-5)
if rightkey()=1 then a#=wrapvalue(a#+5)
rem Update character
y#=get ground height(1,x#,z#)+50.0
position object 1,x#,y#,z#
yrotate object 1,a#
rem Position camera to the back of the character
cx#=newxvalue(x#,wrapvalue(a#+180),300)
cz#=newzvalue(z#,wrapvalue(a#+180),300)
cy#=get ground height(1,cx#,cz#)+200.0
position camera cx#,cy#,cz#
rem Point camera at object
point camera x#,y#,z#
rem Syncronise
sync
rem End loop
loop
Just post here if you have a problem
Thanks,,,
Final Fantasy, best series ever made.