diff options
Diffstat (limited to 'vfg/src/testApp.cpp')
| -rwxr-xr-x | vfg/src/testApp.cpp | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/vfg/src/testApp.cpp b/vfg/src/testApp.cpp index 2a95571..cd7572c 100755 --- a/vfg/src/testApp.cpp +++ b/vfg/src/testApp.cpp @@ -122,7 +122,7 @@ void testApp::setup(){ advert.setLoopState(OF_LOOP_NONE); advert.setVolume(1.0); - background.loadMovie("RAM/Background_v3.mp4"); + background.loadMovie("RAM/Background_v4.mp4"); background.setLoopState(OF_LOOP_NORMAL); background.play(); @@ -193,6 +193,11 @@ void testApp::exit(){ //-------------------------------------------------------------- void testApp::update(){ + if (ofGetHeight()!=gameHeight) { + //game has been resized + for (int i=0;i<songs.size();i++) songs[i]->resize(); + gameHeight=ofGetHeight(); + } int ret=game.update(); if (ret==ASTERISK_GAMESTARTED) { activatePractice(); @@ -203,20 +208,25 @@ void testApp::update(){ endGame(); } } - else if (ret>48&&ret<52) { - songs[currentsong]->playerControl(ret-49); - practiceSong.playerControl(ret-49); - (*playanimal)[ret-49].playNow("Clap"); - } - else if (ret>51&&ret<55) { - songs[currentsong]->playerControl(ret-52); - practiceSong.playerControl(ret-52); - (*playanimal)[ret-52].playNow("Clap"); - } - else if (ret>54&&ret<58) { - songs[currentsong]->playerControl(ret-55); - practiceSong.playerControl(ret-55); - (*playanimal)[ret-55].playNow("Clap"); + if (ret>48&&58) { + if (gamestate==GAME_READY) gamestate=GAME_PRACTICE; //caught missed game acknowledgement! + if (gamestate==GAME_PLAYING||gamestate==GAME_PRACTICE||gamestate==GAME_PRACTICE2) { + if (ret>48&&ret<52) { + songs[currentsong]->playerControl(ret-49); + practiceSong.playerControl(ret-49); + (*playanimal)[ret-49].playNow("Clap"); + } + else if (ret>51&&ret<55) { + songs[currentsong]->playerControl(ret-52); + practiceSong.playerControl(ret-52); + (*playanimal)[ret-52].playNow("Clap"); + } + else if (ret>54&&ret<58) { + songs[currentsong]->playerControl(ret-55); + practiceSong.playerControl(ret-55); + (*playanimal)[ret-55].playNow("Clap"); + } + } } if (songs[currentsong]->isPlaying&&songs[currentsong]->getLevel(ofGetElapsedTimeMillis()+4000)>currentlevel) { int anim=ofRandom(1.9999); //this gives a binary random number @@ -358,7 +368,7 @@ void testApp::draw(){ } } aspect=advert.getHeight()/advert.getWidth(); - float maxwidth=min((float)ofGetWidth(),ofGetHeight()*1.2f); + float maxwidth=ofGetWidth(); //min((float)ofGetWidth(),ofGetHeight()*1.2f); float wstart=(ofGetWidth()-maxwidth)*0.5; wOffs=(ofGetHeight()-(maxwidth*aspect))*0.5; advert.draw(wstart,wOffs,maxwidth,maxwidth*aspect); @@ -457,7 +467,7 @@ void testApp::draw(){ else break; case GAME_ENDTITLE: //DCC LOGO FOR DUBLIN - //logos[1]->draw((gridX[0]*ofGetHeight())+hOffs,gridY[1]*ofGetHeight(),scale); + logos[1]->draw((gridX[0]*ofGetHeight())+hOffs,gridY[1]*ofGetHeight(),scale); case GAME_ENDINGINTRO: case GAME_READY: case GAME_STARTPLAYING: @@ -473,7 +483,7 @@ void testApp::draw(){ } logos[0]->draw((gridX[0]*ofGetHeight())+hOffs,0,scale); break; - + } //draw banner and wirebirds bannerscale=scale; @@ -529,7 +539,8 @@ void testApp::draw(){ case GAME_WALKON: case GAME_ENDINGINTRO: case GAME_INTRO: - case GAME_ENDTITLE: + case GAME_PRACTICE: + case GAME_ENDTITLE: if (ofGetWidth()>ofGetHeight()) { float slice=(ofGetWidth()-ofGetHeight())/2; ofSetColor(0,0,0); |
