I highly recommend a robust message passing system. It will clean up your code in ways almost nothing else can, and helps make it thread safe if you plan to multi-thread it later.
I vaguely knew I was going to have write one of these sooner or later, especially since I was going to add a GUI to my games eventually. However I can't seem to find a good tutorial or article which outlines what I need to do to construct a simple yet robust, functional message passing system. I'm sure I've read something about how to construct a message pump and the appropriate data structures to use somewhere before, but I'm drawing a blank right now.
Does anyone have a link to a good link or reference about writing your own message passing system for a game?