this
#include "DarkGDK.h"
int x = 20;
int y = 60;
void Initialize()
{
dbSetWindowOn ( );
dbSetDisplayMode ( 640, 480, 32 );
dbPositionMouse ( 50, 50 );
}
void LoadImages()
{
dbCreateAnimatedSprite ( 1, "02.png", 5, 4, 1 );
}
void PlaySprite(int sn,int f1,int f2,int dv)
{
if ((dbSpriteFrame(sn)<f1)||(dbSpriteFrame(sn)>f2))
{
dbSetSpriteFrame(sn,f1);
}
dbPlaySprite(sn,f1,f2,dv);
}
void DarkGDK ( void )
{
dbSyncOn();
dbSyncRate(60);
Initialize();
LoadImages();
while ( LoopGDK ( ) )
{
if ( dbRightKey() )
{
x=x+1;
PlaySprite( 1, 7, 10, 100);
}
if( dbLeftKey() )
{
x=x-1;
PlaySprite( 1, 17, 20, 100);
}
if( dbUpKey() )
{
y=y-1;
PlaySprite( 1, 2, 5, 100);
}
if( dbDownKey() )
{
y=y+1;
PlaySprite( 1, 12, 15, 100);
}
dbSprite( 1, x, y, 1 );
dbSync ( );
}
return;
}