Original Post
So I've been pondering way too much about how to separating logic from presentation. The reason I want to find a good way of doing this is not so I can reuse logic code, but rather for easier managing my code. So the parts I got are roughly the MVC pattern, I'll give an example of an entity, such as a player: Model - Contains the state of the entity and interfaces for altering the state - jump(), fire() etc. It also incorporates a tick() for proceeding with the current state each logic update. Controller - Decides what happens. The player Model could for example have a PlayerController that translates keyboard input to corresponding actions. Whether these actions are possible are decided by the model, not the controller. This way I can map different type of controllers to the same type of model without reimplementing the behavior rules of the entity. Presentation - Reads the Model and presents it through graphics and sound. Some things that are not part of the game logic - backgrounds and decorations etc - might even only exist as presentations. So that seemed like a good design I thought, until I realized that these presentations can only react to current states - not events. For example, what if I want to make a sound when somebody removes a line from my Tetris board? The presentation could see that a line has been removed, but what caused it? It could probably deduce some things by comparing previous and next state, but that would lead to duplicate work in model and presentation. Any suggestions? I feel I might just be best off just mixing the models and presentations together again. :)