Load image "dark01.bmp",1
rem load the object and scale it to size
load object "walk.x",10
scale object 10,50,50,50
xrotate object 10,0
yrotate object 10,180
zrotate object 10,0
fix object pivot 10
Rem make matrix
Make matrix 1,10000,10000,20,20
randomize matrix 1,150.0
Rem texture matrix
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
Rem Setup sync
Sync On
Sync Rate 30
Rem Main loop
Do
Rem Store Object angle Y in aY#
aY# = Object angle Y(10)
Rem Control input for camera up
If Upkey()=1 then Move object 10,10
if upkey()=1 then stage =1
if upkey()=0 then stage =0
rem play animation when object moves and stop it when object stops
IF stage<>oldstage
IF stage=0
SET OBJECT FRAME 10,0
wait 1
stop object 10
ENDIF
IF stage=1
play object 10
loop object 10,5,20
SET OBJECT SPEED 10,25
ENDIF
oldstage=stage
ENDIF
rem control input for camera left/right
If Leftkey()=1 then Yrotate object 10,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(aY#+5)
Rem get player object position and store in X# and Z#
X# = Object position x(10)
Z# = Object position z(10)
Rem get new camera position and store in cZ# and cX#
cZ# = Newzvalue(Z#,aY#-180,100)
cX# = Newxvalue(X#,aY#-180,100)
Rem position camera
Position Camera cX#,100,cZ#
Rem point the camera at the player object
Point camera X#,50,Z#
Rem Refresh Screen
Sync
Loop
---------------------------------------------
what you are doing here is saving key() commands as a variable, and then making it to where when the key() commands are pressed it plays the animation and moves the object...
-hope that works
-ThE cOdE kEePeR-
"let me stay where the wind will whisper to me
where the raindrops as they're falling tell a story"