| 1 |
#include "oodle.h" |
| 2 |
|
| 3 |
|
| 4 |
CBarndoorsTransition::CBarndoorsTransition(const CSurface &a, const CSurface &b) |
| 5 |
: leftDoor(CVector(-10,0), CVector(0,0), a.getSection(0,0,a.getWidth()/2, a.getHeight()), "static"), |
| 6 |
rightDoor(CVector(10,0), CVector(a.getWidth()/2,0), a.getSection(a.getWidth()/2,0,a.getWidth()/2, a.getHeight()), "static"), |
| 7 |
b(b) |
| 8 |
{ } |
| 9 |
|
| 10 |
void CBarndoorsTransition::update() |
| 11 |
{ |
| 12 |
leftDoor.update(); |
| 13 |
rightDoor.update(); |
| 14 |
} |
| 15 |
|
| 16 |
void CBarndoorsTransition::draw(CSurface &dest) |
| 17 |
{ |
| 18 |
leftDoor.draw(dest); |
| 19 |
rightDoor.draw(dest); |
| 20 |
} |
| 21 |
|
| 22 |
bool CBarndoorsTransition::done() |
| 23 |
{ |
| 24 |
return (leftDoor.getPos().getX() < leftDoor.getWidth()) && (rightDoor.getPos().getX() > 2*rightDoor.getWidth()); |
| 25 |
} |
| 26 |
|