Posted: 7th Jan 2005 00:08
OK - didn't work again - will post here
SYNC ON
sync rate 30
Hide Mouse
autocam off
Draw to front
rem Position camera off center
rem POSITION CAMERA 0.0,0.0,-1000.0
Backdrop on
Set camera range 1,5000
Fog on
Fog distance 4000
Fog color RGB(128,128,255)
Color Backdrop RGB(128,128,255)
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,220
rem Load 3D object and append walking data to it
LOAD OBJECT "M-Raptor-Idle.x",1 : APPEND OBJECT "M-Raptor-Move.x",1,100
Scale object 1,1000,1000,1000
YROTATE OBJECT 1,180 : FIX OBJECT PIVOT 1
rem Loop 3D object animation from 0 to 20 (idle)
LOOP OBJECT 1,0,20 : SET OBJECT SPEED 1,20
rem position dinosaur
position object 1,5000,Get Ground Height(1,5000,5000),5000
rem position object 1,0,-7,15
rem Lock object on 1
rem Begin loop
DO
Rem Store Object angle
CameraAngleY# = Camera angle Y()
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#,3) : z#=NEWZVALUE(z#,a#,3) : stage=1
IF DOWNKEY()=1 THEN x#=NEWXVALUE(x#,a#,-3) : z#=NEWZVALUE(z#,a#,-3) : stage=1
rem If character action changes
IF stage<>oldstage
IF stage=0
SET OBJECT FRAME 1,0.0
LOOP OBJECT 1,0,20
SET OBJECT SPEED 1,10
ENDIF
IF stage=1
SET OBJECT FRAME 1,105.0
LOOP OBJECT 1,105,125
SET OBJECT SPEED 1,40
ENDIF
oldstage=stage
ENDIF
rem Update character position and angle
Y# = Get Ground Height(1,X#,Z#)
POSITION OBJECT 1,x#,y#,z#
YROTATE OBJECT 1,a#
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
cy# = Newyvalue(y#,aY#-180,100)
Y# = Get ground height(1,X#,Z#)
Rem position camera
Position Camera cX#,y#+35,cZ#
Rem point the camera at the player object
Point camera X#,y#+35,Z#
rem Refresh screen
SYNC
rem End loop
LOOP