I am trying to make my sprite to appear from alpha of 0 to alpha of 255. But when I try my code,program just freezes and loads up after all the time has passed.
Header
//i use this for delay
void delay(int iMs)
{
clock_t end;
end=clock()+iMs;
while(clock()<end){}
}
CPP
//this is in GDK void,not loop.
dbSprite(1,dbScreenWidth()/2-256,dbScreenHeight()/2-256,1);
dbSetSpriteAlpha(1,0);
for(int i=0; i<255; i++)
{
delay(10);
dbSetSpriteAlpha(1,i);
}
I have also tried using dbWait,dbSleep but it makes no effect..
Any help would be appreciated.
~Murloc.
Theory-When you know everything,but nothing works.
Practice-When everything works,but you don't know why.
Programming merges these two-Nothing works,and you don't know why.