Animations in the HUD (Techie Question)

Need help with using DizzyAGE then look here
User avatar
Noggin the Nog
Hard Boiled Egg
Posts: 408
Joined: Sun Jul 01, 2012 12:04 am

Animations in the HUD (Techie Question)

Postby Noggin the Nog » Sun May 10, 2015 8:59 pm

Hi, my latest game is almost ready and there's this small problem with it.

I've put some moving bits in the HUD which I've implemented by using counters in the DrawHud Handler. Something like this:

Code: Select all

y = GameGet(G_COUNTER);
GameSet(G_COUNTER, y+1);

HudDrawTile( 99, 140, 24+y, 20, 20, 0, 0, 20, 20, 0, 0 );

if(y==150) GameSet(G_COUNTER, 0);



The problem is that the animation sometimes runs too fast when you use this technique in the HUD. Seriously, it sometimes whizzes through the frames like 20x the normal speed, which looks awful.

Does anyone know why this happens or if there's a way to fix it? I think it tends to happen more when I've got other programs running.

cron