diff options
| author | Comment <tim@gray.(none)> | 2012-12-18 12:45:26 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2012-12-18 12:45:26 +0000 |
| commit | 27e13ea8412d2a1f46345f9c0fcafa1e86551728 (patch) | |
| tree | 68b083f478b92029c1cbd8b8c2b431528c35495d | |
| parent | 066b911b19d93191fd5a89b8cd14c51aa18e2fd9 (diff) | |
final dublin version
| -rwxr-xr-x | vfg/src/Asterisk.cpp | 3 | ||||
| -rwxr-xr-x | vfg/src/music.cpp | 4 | ||||
| -rwxr-xr-x | vfg/src/music.h | 2 | ||||
| -rwxr-xr-x | vfg/src/testApp.cpp | 11 | ||||
| -rwxr-xr-x | vfg/src/testApp.h | 1 | ||||
| -rw-r--r-- | vfg/vfg.layout | 28 |
6 files changed, 26 insertions, 23 deletions
diff --git a/vfg/src/Asterisk.cpp b/vfg/src/Asterisk.cpp index f1b8058..0572add 100755 --- a/vfg/src/Asterisk.cpp +++ b/vfg/src/Asterisk.cpp @@ -169,7 +169,8 @@ int Asterisk::update(){ return 0;
}
else {
- //message length of <3 is a key
+ //message length of <3 is a key + if (state!=ASTERISK_PLAYING) state=ASTERISK_PLAYING; //catch missed game acknowledgement
return ofToInt(msg);
}
}
diff --git a/vfg/src/music.cpp b/vfg/src/music.cpp index a3ebfc5..4c565bb 100755 --- a/vfg/src/music.cpp +++ b/vfg/src/music.cpp @@ -334,7 +334,7 @@ bool song::isFinished(){ void song::resize(){ lyrics.loadFont(); }
-void song::draw(float hOffs,float scale){
+void song::draw(float hOffs,float scale,bool showLyrics){
int songTime=ofGetElapsedTimeMillis()-startTime; int fadeout=(gameover?max(0,255-((int)((((float)ofGetElapsedTimeMillis()-gameoverTime)/fademillis)*255))):255);
if (isPlaying) {
@@ -359,7 +359,7 @@ void song::draw(float hOffs,float scale){ }
}
if (!notes.missedLast&&!gameover) melody.setVolume(1.0f); - if (!isPractice&&!gameover) lyrics.draw(hOffs);
+ if (!isPractice&&!gameover&&showLyrics) lyrics.draw(hOffs);
if (songTime>levels.length&&!gameover) {
printf("finished! %i (%i)\n",songTime,levels.length); //this played loads of times
diff --git a/vfg/src/music.h b/vfg/src/music.h index 8792d6a..3fcd5ac 100755 --- a/vfg/src/music.h +++ b/vfg/src/music.h @@ -203,7 +203,7 @@ class song { void setFlakeThresh(int tS,int tE);
void setKeyThresh(int millis);
void drawNotes(float hOffs);
- void draw(float hOffs,float scale); + void draw(float hOffs,float scale,bool showLyrics=true); int missedNote();
int hitNote();
bool isPlaying;
diff --git a/vfg/src/testApp.cpp b/vfg/src/testApp.cpp index cd7572c..6d2155c 100755 --- a/vfg/src/testApp.cpp +++ b/vfg/src/testApp.cpp @@ -157,6 +157,7 @@ void testApp::setup(){ birdpoint=0.6; gui.add(bP.setup("wire level",birdpoint,0.5,0.7,255)); gui.add(showWire.setup("wire",true)); + gui.add(showLyrics.setup("lyrics",true)); ofxFenster* win=ofxFensterManager::get()->createFenster(0, 0, 200, 400, OF_WINDOW); win->setWindowTitle("config"); @@ -368,7 +369,7 @@ void testApp::draw(){ } } aspect=advert.getHeight()/advert.getWidth(); - float maxwidth=ofGetWidth(); //min((float)ofGetWidth(),ofGetHeight()*1.2f); + float maxwidth=ofGetHeight(); //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); @@ -427,8 +428,8 @@ void testApp::draw(){ hit=songs[currentsong]->hitNote(); if (hit>-1) (*playanimal)[hit].play("Catch"); for (int i=0;i<3;i++) (*playanimal)[i].draw(hOffs+(gridX[i+1]*ofGetHeight()),gridY[0]*ofGetHeight(),scale); - lyricspanel->draw(ofGetWidth()*0.5,ofGetHeight()*gridY[1],scale); - songs[currentsong]->draw(hOffs,scale); + if (showLyrics) lyricspanel->draw(ofGetWidth()*0.5,ofGetHeight()*gridY[1],scale); + songs[currentsong]->draw(hOffs,scale,showLyrics); break; case GAME_ENDPLAYING: //6 seconds to walk in / out -> 12 seconds turnaround @@ -689,8 +690,8 @@ void testApp::queueWalkOn(){ numcycles=7; } else { - start=200; //of 780 was 400 - numcycles=5; + start=500; //of 780 was 400 + numcycles=6; } (*playanimal)[i].play("Walking",ofGetElapsedTimeMillis()+start); for (int j=0;j<numcycles;j++) (*playanimal)[i].play("Walking"); diff --git a/vfg/src/testApp.h b/vfg/src/testApp.h index a405972..7f9faa6 100755 --- a/vfg/src/testApp.h +++ b/vfg/src/testApp.h @@ -141,6 +141,7 @@ class testApp : public ofxFensterListener{ ofxFloatSlider bP; ofxParameter<float> birdpoint; ofxToggle showWire; + ofxToggle showLyrics; }; diff --git a/vfg/vfg.layout b/vfg/vfg.layout index 2fbc6b6..ffee218 100644 --- a/vfg/vfg.layout +++ b/vfg/vfg.layout @@ -4,17 +4,17 @@ <File name="addons.make" open="1" top="0" tabpos="1"> <Cursor position="80" topLine="0" /> </File> - <File name="src/Asterisk.cpp" open="1" top="0" tabpos="4"> - <Cursor position="484" topLine="0" /> + <File name="src/Asterisk.cpp" open="1" top="0" tabpos="9"> + <Cursor position="2745" topLine="74" /> </File> - <File name="src/Asterisk.h" open="0" top="0" tabpos="3"> - <Cursor position="106" topLine="23" /> + <File name="src/Asterisk.h" open="1" top="0" tabpos="8"> + <Cursor position="106" topLine="20" /> </File> - <File name="src/Puppet.cpp" open="1" top="0" tabpos="8"> + <File name="src/Puppet.cpp" open="1" top="0" tabpos="7"> <Cursor position="1376" topLine="0" /> </File> - <File name="src/Puppet.h" open="1" top="0" tabpos="7"> - <Cursor position="789" topLine="14" /> + <File name="src/Puppet.h" open="1" top="0" tabpos="6"> + <Cursor position="789" topLine="12" /> </File> <File name="src/Tag.h" open="0" top="0" tabpos="5"> <Cursor position="551" topLine="0" /> @@ -22,16 +22,16 @@ <File name="src/main.cpp" open="0" top="0" tabpos="1"> <Cursor position="219" topLine="0" /> </File> - <File name="src/music.cpp" open="1" top="0" tabpos="6"> - <Cursor position="10249" topLine="255" /> + <File name="src/music.cpp" open="1" top="1" tabpos="5"> + <Cursor position="12218" topLine="331" /> </File> - <File name="src/music.h" open="1" top="0" tabpos="5"> - <Cursor position="6912" topLine="197" /> + <File name="src/music.h" open="1" top="0" tabpos="4"> + <Cursor position="6499" topLine="197" /> </File> <File name="src/testApp.cpp" open="1" top="0" tabpos="3"> - <Cursor position="8311" topLine="218" /> + <Cursor position="14356" topLine="401" /> </File> - <File name="src/testApp.h" open="1" top="1" tabpos="2"> - <Cursor position="1353" topLine="19" /> + <File name="src/testApp.h" open="1" top="0" tabpos="2"> + <Cursor position="2868" topLine="114" /> </File> </CodeBlocks_layout_file> |
