| 816 | } |
| 817 | |
| 818 | void TMXIsoZorderNew::repositionSprite(float dt) |
| 819 | { |
| 820 | auto p = _tamara->getPosition(); |
| 821 | p = AX_POINT_POINTS_TO_PIXELS(p); |
| 822 | auto map = getChildByTag(kTagTileMap); |
| 823 | |
| 824 | // there are only 4 layers. (grass and 3 trees layers) |
| 825 | // if tamara < 48, z=4 |
| 826 | // if tamara < 96, z=3 |
| 827 | // if tamara < 144,z=2 |
| 828 | |
| 829 | int newZ = 4 - (p.y / 48); |
| 830 | newZ = std::max(newZ, 0); |
| 831 | |
| 832 | map->reorderChild(_tamara, newZ); |
| 833 | } |
| 834 | |
| 835 | std::string TMXIsoZorderNew::title() const |
| 836 | { |
nothing calls this directly
no test coverage detected