diff options
Diffstat (limited to 'gaunt01/src/testApp.cpp')
| -rw-r--r-- | gaunt01/src/testApp.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/gaunt01/src/testApp.cpp b/gaunt01/src/testApp.cpp index 01afe95..8a8f65d 100644 --- a/gaunt01/src/testApp.cpp +++ b/gaunt01/src/testApp.cpp @@ -104,6 +104,9 @@ void testApp::setup(){ segTimes[GOTCHA]=2.0; gameStart=ofGetElapsedTimef(); + + sounds=new ofSoundPlayer[1]; + sounds[0].loadSound("arp5.mp3"); //game start } ofVec2f testApp::screen2plane(ofVec2f screenpos){ @@ -247,6 +250,7 @@ void testApp::update(){ if (firstframe) { accumImg=grayImage; firstframe=false; + sounds[0].play(); } else { accumImg.addWeighted( grayImage, 1.0/bgnum ); @@ -360,7 +364,7 @@ void testApp::draw(){ ofPopMatrix(); glDisable(GL_DEPTH_TEST); - ofSetHexColor(0xffffff); +https://twitter.com/# ofSetHexColor(0xffffff); bindTexture(colorImg); //colorImg.getTextureReference().bind(); map<int,player>::iterator it; for(int i=0;i<blobsManager.blobs.size();i++){ @@ -393,6 +397,7 @@ void testApp::draw(){ case PLAYING: if (gameTime>segTimes[gameState]) { gameState=TITLES; + sounds[0].play(); gameStart=ofGetElapsedTimef(); gameTime=0.0f; } @@ -657,6 +662,10 @@ void testApp::keyPressed(int key){ } else drawingborder=false; break; + case '>': + gameState=(gameState+1)%4; + gameStart=ofGetElapsedTimef(); + break; } } @@ -716,6 +725,12 @@ void testApp::loadSettings(string filename){ }else{ cam_angle=ofToInt(XML.getAttribute("gauntlet","cam_angle","none",0)); threshold=ofToInt(XML.getAttribute("gauntlet","threshold","none",0)); + if(XML.pushTag("bounds")) { + for (int i=0;i<XML.getNumTags("vertex");i++){ + border.push_back(ofVec2f(ofToFloat(XML.getAttribute("vertex","x","0",i)),ofToFloat(XML.getAttribute("vertex","y","0",i)))); + } + XML.popTag(); + } printf("loaded %s\n",filename.c_str()); } } @@ -723,6 +738,16 @@ void testApp::loadSettings(string filename){ void testApp::saveSettings(string filename){ XML.setAttribute("gauntlet","cam_angle",ofToString(cam_angle),0); XML.setAttribute("gauntlet","threshold",ofToString(threshold),0); + if (XML.tagExists("bounds")) XML.removeTag("bounds"); + XML.addTag("bounds"); + if(XML.pushTag("bounds")) { + for (int i=0;i<border.size();i++){ + XML.addTag("vertex"); + XML.setAttribute("vertex","x",ofToString(border[i].x),i); + XML.setAttribute("vertex","y",ofToString(border[i].y),i); + } + XML.popTag(); + } XML.saveFile(filename); printf("saved %s\n",filename.c_str()); } |
