* Animate the tile. This means to advance the current frame for every object. * Ufo doors are a bit special, they animated only when triggered. * When ufo doors are on frame 0(closed) or frame 7(open) they are not animated further. */
| 580 | * When ufo doors are on frame 0(closed) or frame 7(open) they are not animated further. |
| 581 | */ |
| 582 | void Tile::animate() |
| 583 | { |
| 584 | int newframe; |
| 585 | for (int i=0; i < 4; ++i) |
| 586 | { |
| 587 | if (_objects[i]) |
| 588 | { |
| 589 | if (_objects[i]->isUFODoor() && (_currentFrame[i] == 0 || _currentFrame[i] == 7)) // ufo door is static |
| 590 | { |
| 591 | continue; |
| 592 | } |
| 593 | newframe = _currentFrame[i] + 1; |
| 594 | if (_objects[i]->isUFODoor() && _objects[i]->getSpecialType() == START_POINT && newframe == 3) |
| 595 | { |
| 596 | newframe = 7; |
| 597 | } |
| 598 | if (newframe == 8) |
| 599 | { |
| 600 | newframe = 0; |
| 601 | } |
| 602 | _currentFrame[i] = newframe; |
| 603 | } |
| 604 | } |
| 605 | } |
| 606 | |
| 607 | /** |
| 608 | * Get the sprite of a certain part of the tile. |
nothing calls this directly
no test coverage detected