ok some of the code in the last bit was a little weird.
ok so isnt dbPlaySprite ( 1, 10, 12, 75 );, for example, suppose to just play frames 10 to 12.... this is for the animation for moving downward, so if i was to move up and then down its going to play from frames 1 to 12 and then loop from 10 to 12...
Has anyone else run across this issue. I can find no way to use dbSetSpriteFrame without it playing the same frame i set over and over in the game loop.
Check this out and someone get back to me please. PLEASE!
#include "DarkGDK.h"
int iCharPosX = 2;
int iCharPosY = 2;
void MovementF(void);
void DarkGDK ( void )
{
dbSyncOn ( );
dbDisableEscapeKey ( );
dbSyncRate ( 60 );
dbLoadImage ("grass.bmp" , 2);
dbLoadMusic ( "FF7choct.mid", 1 );
dbSprite(2,0,0,2);
dbSetImageColorKey ( 255, 0, 255 );
dbCreateAnimatedSprite (1, "choco.bmp", 6, 3, 9 );
dbPlayMusic ( 1 ) ;
dbLoadSound ("wark.wav" , 1);
while ( LoopGDK ( ) )
{
dbSync ( );
dbSprite(1,iCharPosX, iCharPosY,1);
MovementF();
}
return;
}
void MovementF(void)
{
if ( dbLeftKey () == 1)
{
dbPlaySprite ( 1, 4, 6, 75 );
iCharPosX = iCharPosX - 2;
if (iCharPosX == 0)
{
iCharPosX = iCharPosX + 2;
}
}
if ( dbRightKey () == 1)
{
dbPlaySprite ( 1, 10, 12, 75 );
iCharPosX = iCharPosX + 2;
if (iCharPosX == 640)
{
iCharPosX = iCharPosX - 2;
}
}
if ( dbUpKey () == 1 )
{
dbPlaySprite ( 1, 1, 3, 75 );
iCharPosY = iCharPosY - 2;
if (iCharPosY == 0)
iCharPosY = iCharPosY + 2;
}
if ( dbDownKey () == 1)
{
dbPlaySprite ( 1, 7, 9, 75 );
iCharPosY = iCharPosY + 2;
if (iCharPosY == 480)
{
iCharPosY = iCharPosY - 2;
}
}
if ( dbSpaceKey () == 1)
{
dbPlaySprite ( 1, 16, 18, 75 );
dbPlaySound (1);
}
}
Adam Androulidakis