Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame independent updates #46

Open
macskay opened this issue Apr 26, 2018 · 1 comment
Open

Frame independent updates #46

macskay opened this issue Apr 26, 2018 · 1 comment
Assignees

Comments

@macskay
Copy link
Owner

macskay commented Apr 26, 2018

At the moment the updates are frame-dependent rather than time-dependent. That should be updated

@macskay macskay self-assigned this Apr 26, 2018
@macskay macskay added this to the Technical Debt milestone Apr 26, 2018
@ghost
Copy link

ghost commented May 29, 2018

For this I suggest using composition. Have the Game class have a property called game_loop which is a callable. The callable is passed an instance of the game and is expected to implement the logic of one iteration of the main loop. Game will continuously call it so long as the stack is not empty.

This is essentially the strategy pattern. It will enable you to implement various mainloop strategies, such as FrameDependentMainLoop and TimeDependentMainLoop. It also makes it as easy as writing a single function for consumers of Taz to have their own completely custom game loop without having to subclass the Game class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant