diff options
| author | Tim Redfern <tim@eclectronics.org> | 2012-04-19 02:14:26 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2012-04-19 02:14:26 +0100 |
| commit | 09fba466578c1074bf7471bbc4615a9047237d46 (patch) | |
| tree | 5741542ed77047527414218d4d192bd5b590d41b /gaunt01/src/trapdoor.cpp | |
| parent | c4fc08cc7238dfa310ed56e65a24df22c6bbb625 (diff) | |
bird chasing players
Diffstat (limited to 'gaunt01/src/trapdoor.cpp')
| -rw-r--r-- | gaunt01/src/trapdoor.cpp | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/gaunt01/src/trapdoor.cpp b/gaunt01/src/trapdoor.cpp index 46151c1..5fc639f 100644 --- a/gaunt01/src/trapdoor.cpp +++ b/gaunt01/src/trapdoor.cpp @@ -100,15 +100,17 @@ float trapdoor::getFalldist(){ bool trapdoor::checkUpdate(map<int,player>& players) { map<int,player>::iterator it; for (it=players.begin();it!=players.end();it++) { - ofVec3f p=it->second.getWorldPosition(); - ofRectangle r=getInnerRect(); - if (getInnerRect().inside(p.x,p.y)&&!it->second.isCaught) { - trigger(); - it->second.caught(); - printf("caught!\n"); - caught.push_back(&(it->second)); - caughtTime.push_back(ofGetElapsedTimef()); - sounds[3].play(); //falling down hole + if (it->second.active) { + ofVec3f p=it->second.getWorldPosition(); + ofRectangle r=getInnerRect(); + if (getInnerRect().inside(p.x,p.y)&&!it->second.isCaught) { + trigger(); + it->second.caught(); + printf("caught!\n"); + caught.push_back(&(it->second)); + caughtTime.push_back(ofGetElapsedTimef()); + sounds[3].play(); //falling down hole + } } } for (int i=0;i<caught.size();i++) { @@ -148,13 +150,6 @@ void trapdoor::drawDebug() { glVertex3f(getInnerRect().x,getInnerRect().y,0); glEnd(); - ofSetHexColor(0x0000ff); - glBegin(GL_LINES); - for (int i=0;i<caught.size();i++) { - glVertex3f(caught[i]->getCaughtPos().x,caught[i]->getCaughtPos().y,0); - glVertex3f(caught[i]->getScreenPosition().x,caught[i]->getScreenPosition().y,0); - } - glEnd(); } void trapdoor::draw() { |
