Splitting a tetris game apart - where to put time-management?
Posted
by
nightcracker
on Game Development
See other posts from Game Development
or by nightcracker
Published on 2011-05-02T01:02:24Z
Indexed on
2012/06/20
3:25 UTC
Read the original article
Hit count: 233
I am creating a tetris game in C++ & SDL, and I'm trying to do it "good" by making it object-oriented and keeping scopes small. So far I have the following structure:
- A main with some lowlevel SDL set up and handling input
- A game class that keeps track of score and provides the interface for main (move block down, etc)
- A map class that keeps track of the current game field, which blocks are where. Used by the game class.
- A block class that consists of the current falling block, used by game.
- A renderer class abstracting low level SDL to a format where you render "tetris blocks". Used by map and block.
Now I have a though time where to place the time-management of this game. For example, where should be decided when a block bumps the bottom of the screen how long it takes the current block locks in place and a new block spawns?
I also have an other unrelated question, is there some place where you can find some standard data on tetris like standard score tables, rulesets, timings, etc?
© Game Development or respective owner