fanglingsu/nyancat-console — Issue #1: Eventqueue
Author: fanglingsu
Created: 2011-12-18 14:39:49+00:00
State: open

Add event queue to allow several event to be triggered at dedicated time.
This will be eminent to remove the current inflexible way to handle
movements and key presses FPS times in a second, which leads to cruel code
that performs some modulo operation on elapsed frames - what make the
movements unnatural and rugged.

possible event struct:

typedef void (*event_callback) (game_time, void *);
struct event {
struct event *next; /* holds the next event in queue */
game_time time; /* time, when the event should happen */
event_callback callback; /* function to call */
void *callback_data; /* argument to pass - is this needed? */
};