I'm somewhat of a seasoned developer but this is my first time tackling a somewhat large game project (i.e. more than the basic pong).
My quesion revolves around the order of events within a game loop and how input should be thrown in there. In my comments, I have something sort of like this (note, I am using PocketFrog if that helps)
Is this kind of how it should be done, or is it better to let the individual objects themselves determine the input state? PocketFrog has callbacks for ButtonDown and ButtonUp which seems to imply that some sort of controller object notifies the individual objects about the input state.
How do you do it?
-Mark
My quesion revolves around the order of events within a game loop and how input should be thrown in there. In my comments, I have something sort of like this (note, I am using PocketFrog if that helps)
- Code:
GameLoop
{
// get input state
// update objects (AI, PC, static obj's etc...)
// draw background
// draw objects
// update screen(flip)
}
Is this kind of how it should be done, or is it better to let the individual objects themselves determine the input state? PocketFrog has callbacks for ButtonDown and ButtonUp which seems to imply that some sort of controller object notifies the individual objects about the input state.
How do you do it?
-Mark