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

Move tick/render logic in engine to GameMode #17

Open
Osmose opened this issue Apr 6, 2012 · 0 comments
Open

Move tick/render logic in engine to GameMode #17

Osmose opened this issue Apr 6, 2012 · 0 comments
Labels

Comments

@Osmose
Copy link
Owner

Osmose commented Apr 6, 2012

As a part of the ongoing effort to separate "engine code" from "game code", we should modify the engine to support Game Modes as a way of changing the logic each frame.

For example, the default GameMode would just call tick() and render() on every registered Entity, whereas a MenuGameMode would move a cursor around a menu screen, and a SceneGameMode would execute actions based on a script defining the cutscene (delay, move entity, play animation at x, play sound, etc).

GameModes should be stored in a stack, so that a MenuGameMode is pushed on top of the stack, and popped off when the menu is finished and gameplay should continue.

There will be some shared state between GameModes (entities and tilesets, for example), as well as internal state (menu cursor position).

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

No branches or pull requests

1 participant