A89: Re: delay routine


[Prev][Next][Index][Thread]

A89: Re: delay routine




I take it that running the subroutine associated with the keypress is what's
slowing it down.  what I've done to synchronize control is set a flag in an
auto int 5 handler, then in the main loop of your program wait until you see
that flag set before continuing on.  you can even have a large number of
enemies controlled at once and the gameplay will remain the same as if there
were no enemies .. that is until you have so many enemies that the
synchronization overflows.. so be sure to set up your delay such that if it
overflows (a single game cycle exceeds the length of time it takes for
however many int 5s to occur as you specify), you don't have to for a second
synchronization before continuing with the main loop.
I found that about 32 int 5s is about the proper synchronization for a
normal side scrolling game.  I can show you parts of the source to
somnabulist I used for synchronization if you want.


>
> my problem is that, when you hold down a key, it will considerably slow
down
> the cycles of the game.  is there a way to make sure that each cycle is
the
> same speed no matter what?   tia
>
> if you need a demo of this, you can check out my first game Crapong.  it
is
> available on ticalc.  the reason i am asking about it is that i am
currently
> making a new game, but am plagued by the same problem.
>
>



References: