Good game state

- Put main into a state.
- Solve emitter performance issue.