Here is the code:
rem ===========================================
rem DARK BASIC EXAMPLE PROGRAM 3
rem ===========================================
rem This program operates a third person camera
rem -------------------------------------------
rem Make a simple scene for the camera to look at
make matrix 1,10000.0,10000.0,25,25
load bitmap "yellowjade.bmp",1
get image 1,0,0,256,256
delete bitmap 1
prepare matrix texture 1,1,2,2
randomize matrix 1,50.0
set matrix height 1,12,12,300.0
update matrix 1
rem Create blob character to follow
REM HERE I PUT MY OWN OBJECT im not sure how to do it actually
load object "bruce standing positioned.x", 1 : append object "bruce walking 2.x",1,100
Yrotate object 1,180:fix object pivot 1
scale object 1,1000,1000,1000
rem Set variables for character position
x#=5000
z#=5000
rem Activate manual sync
sync on
rem Begin loop
do
rem Control camera with arrow keys
if rightkey()=1 then x#=newxvalue(x#,a#,5) : z#=newzvalue(z#,a#,5)
if leftkey()=1 then x#=newxvalue(x#,a#,-5) : z#=newzvalue(z#,a#,-5)
if upkey()=1 then a#=wrapvalue(a#-5.0)
if downkey()=1 then a#=wrapvalue(a#+5.0)
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#+80),100)
cz#=newzvalue(z#,wrapvalue(a#+80),100)
cy#=get ground height(1,cx#,cz#)+100.0
position camera cx#,cy#,cz#
rem Point camera at object
point camera x#,y#,z#
rem Syncronise
sync
rem End loop
loop
What i want help with is making it so when i press the right arrow key an anim of the man walking loads and plays. I also want to assighn a few other animations of the model to load and play when i press the assighned keys, so i can have him standing when i press nothing, walking when i press left or right key (not just having the first object anim "bruce standing.x" sliding around") and how to load other animations doing some other stuff like throwing different punches when i press different number pad keys.
I need to assighn an animation to each key.
Where and what would i type in this program to turn the desired result? Plz modify the code above, explain it and put it in your reply to make an example.
all help it GREATLY appreciated!