Observer Pattern Implementation

Posted by user17028 on Game Development See other posts from Game Development or by user17028
Published on 2012-06-15T02:57:37Z Indexed on 2012/06/15 15:28 UTC
Read the original article Hit count: 204

Filed under:
|

To teach myself basic game programming, I am going to program a clone of Pong. I will use the Observer design pattern, with an interface between the input and the game engine. However, I'm not sure what the interface should do. One idea I had was for the input interface to tell the game engine that (e.g.) the screen was clicked, then to let the game engine decide what to do with that information (shoot a bullet, for example). Another idea I had was for the input interface, having caught the mouse click, to tell the game engine to shoot a bullet.

Which method would be better for me to use?

© Game Development or respective owner

Related posts about input

Related posts about structure