summaryrefslogtreecommitdiffstats
path: root/ksirtet/DESIGN
blob: 0cc7d3d2feab85539f3a5865c6f3317db99d6220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
'lo, time to explain how some things are designed in the generic class
of these games

NB: You should read this file with a fixed font editor ...

the following set of functions is implemented in the hierarchy of classes :
GenericTetris -> BaseBoard -> Board -> specific Board class for each game

===============================================================================
action 'Piece Drop Down' activated
 |
pieceDropped()           <-|
 |                         |
oneLineDown() -> by timer -|

===============================================================================
if oneLineDown() make the piece touch the ground
 |
pieceDropped()           
 |                         
_beforeGlue()            <-|
 |                         |
beforeGlue()  -> by timer -|    // here is implemented the bump effect
 | (when done)
gluePiece()
 |
_afterGlue()             <-|
 |                         |
afterGlue()   -> by timer -|    // here kfouleggs remove holes
 | (when done)
needRemoving ? no -> _afterAfterRemove()
 |
_beforeRemove()           <-|
 |                          |
beforeRemove() -> by timer -|   // here blocks to be removed are highlighted
 | (when done)
remove()
 |
_afterRemove()           <-|
 |                         |
afterRemove() -> by timer -|    // here is animated the fall of piece in
 |                              // the holes leaved by removed blocks
 | if needs removing again -> _beforeRemove()
 |
_afterAfterRemove() ? no gift pending -> afterAfterRemove()
 |
putGift()
 |
_afterGift()           <-|
 |                       |
afterGift() -> by timer -|  // here kfouleggs make the gift block to land
 |
_afterAfterRemove()
 |
afterAfterRemove() ? gameOver -> gameOver()
 |
newPiece()