New answers tagged

2

Your game loop doesn't follow the traditional pattern of polling for input, updating your objects, and finally rendering them. Your current implementation will result in exactly what you describe, where the first object receives all of the input events SDL sends you. So instead of what you have currently, you want something like the following: while (running)...


0

If you want to retain separation of concerns in an object-oriented system, and want a high amount of flexibility in how objects react to time, this would be a good use case for the Observer Pattern and the Reactive Extensions for your chosen programming language. (Although the pattern can be implemented without the extensions, it does handle some of the ...


Top 50 recent answers are included