Thanx this helped me a great deal!
I made a little code here it is:
// Dark GDK - The Game Creators - www.thegamecreators.com
// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
int SPRITE_ID=1;
// the main entry point for the application is this function
void make_sprite(){
dbLoadImage ("ant.png",1);
dbSprite (SPRITE_ID,200,200,1);
dbSizeSprite (SPRITE_ID ,100,100);
dbOffsetSprite(SPRITE_ID,50,50);
}
void rotate_sprite(){
int angle=90;
if (dbKeyState(17)==1){
dbRotateSprite (SPRITE_ID,dbWrapValue(dbSpriteAngle(SPRITE_ID)+angle));
}
}
void DarkGDK ( void )
{
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn ( );
dbSyncRate ( 60 );
make_sprite();
// our main loop
while ( LoopGDK ( ) )
{
rotate_sprite();
// update the screen
dbSync ( );
}
// return back to windows
return;
}
when i press w the ant changes angle for 90 degrees. But when i press the button once the rotation happens atleast twice. What do i do, to make the rotation to happen only once when i press the button once?