Started today on experimenting with sprites, I tried to use dbMoveSprite command to move the sprite to the right and the left, but instead it moves up and down. Any suggestions why it does?
Here's the code used
#include "DarkGDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbLoadImage ( "background_forest.jpg", 1 );
dbLoadImage ( "panda.png", 2 );
dbLoadImage ( "grunt.png", 3 );
dbSprite ( 1, 0, 0, 1 );
dbSprite ( 2, 100, 100, 2 );
dbSprite ( 3, 100, 400, 3 );
dbSetImageColorKey ( 255, 0, 255 );
while ( LoopGDK ( ) )
{
if (dbRightKey()==1)
{
dbMoveSprite(2,2);
}
if (dbLeftKey()==1)
{
dbMoveSprite(2,-2);
}
if (dbSpriteCollision(2,3) ==1)
{
dbWaitKey();
}
dbSync ( );
}
return;
}
Any help would be highly appreciated, thank you
Michel Cilissen - CiliSoft Software Solutions
michel@techblog24.com - http://www.cilisoft.tk