while ( LoopGDK ( ) )
{
dbPositionCamera (dbObjectPositionX(1), dbObjectPositionY(1) + 5, dbObjectPositionZ(1));
//move camera backwards
dbMoveCamera(-10);
// move the player forwards
if ( dbKeyState(17) ) //W
dbMoveObject ( 1, -0.2 );
// move the player backwards
if ( dbKeyState(31) )//S
dbMoveObject ( 1, 0.2 );
// rotation
if(dbKeyState(30))//A
dbTurnObjectLeft(1, 1.8);
if(dbKeyState(32))//D
dbTurnObjectRight(1, 1.8);
if(dbKeyState(17) == 1 ) {//walk foward-start
dbLoopObject(1,596,619);
dbSetObjectSpeed(1,40);
}
if(dbKeyState(17) == 0 ) {//walk foward-stop
dbLoopObject(1,584,584);
}
if(dbControlKey() == 1 ) {//crouch-still-start
dbLoopObject(1,733,752);
}
if(dbControlKey() == 0 ) {//crouch-still-stop
dbLoopObject(1,584,584);
}
when i press 'W' key, my guy would start walking forward with the animation, but when i added the animation for crouch, it does the crouch, but no longer will do the walking animation when i press 'W' and i set for crouch to be the 'Ctrl' key if that has anything to do to it, if you can help with this thatll be nice, thanks.