From 27e13ea8412d2a1f46345f9c0fcafa1e86551728 Mon Sep 17 00:00:00 2001 From: Comment Date: Tue, 18 Dec 2012 12:45:26 +0000 Subject: final dublin version --- vfg/src/Asterisk.cpp | 3 ++- vfg/src/music.cpp | 4 ++-- vfg/src/music.h | 2 +- vfg/src/testApp.cpp | 11 ++++++----- vfg/src/testApp.h | 1 + vfg/vfg.layout | 28 ++++++++++++++-------------- 6 files changed, 26 insertions(+), 23 deletions(-) (limited to 'vfg') 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 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 @@ - - + + - - + + - + - - + + @@ -22,16 +22,16 @@ - - + + - - + + - + - - + + -- cgit v1.2.3