Hi, thanks for the reply.
I Used an int value to keep the direction of my spirite and then used dbSetSpriteFrame() but after doing this my dbPlaySrite function doesnt play my sprites, it just displays the 1 sprite I set with dbSetSpriteFrame.
void PLAYER::PlayerMovement()
{
int Direction = 3; //1=up 2=down 3=left 4=right
if (dbUpKey()==1)
{ if (Direction != 1)
{
dbSetSpriteFrame(1,3);
}
dbMoveSprite(1,1);
dbPlaySprite(1,3,4,200);
}
if (dbDownKey()==1)
{
if (Direction != 2)
{
Direction=2;
dbSetSpriteFrame(1,1);
}
dbMoveSprite(1,-1);
dbPlaySprite(1,1,2,200);
}
if (dbLeftKey()==1)
{ if (Direction !=3)
{
Direction=3;
dbSetSpriteFrame(1,7);
dbPlaySprite(1,7,8,200);
}
dbRotateSprite(1,270);
dbPlaySprite(1,7,8,200);
dbMoveSprite(1,1);
dbRotateSprite(1,0);
}
if (dbRightKey()==1)
{
if (Direction != 4)
{
Direction=4;
dbSetSpriteFrame(1,5);
}
dbRotateSprite(1,270);
dbMoveSprite(1,-1);
dbRotateSprite(1,0);
dbPlaySprite(1,5,6,200);
}
}
Should it matter that im using an int to keeo track of my Direction? (as long as i leave comments to rememerb)
thanks