summaryrefslogtreecommitdiff
path: root/vfg/src/testApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vfg/src/testApp.cpp')
-rwxr-xr-xvfg/src/testApp.cpp56
1 files changed, 42 insertions, 14 deletions
diff --git a/vfg/src/testApp.cpp b/vfg/src/testApp.cpp
index a325064..4e5e576 100755
--- a/vfg/src/testApp.cpp
+++ b/vfg/src/testApp.cpp
@@ -49,7 +49,7 @@ void testApp::setup(){
//songs.push_back(new song("WeWishYouAMerryChistmas_v.2.1/VODA_MUS_WEWISHU_Backing_v.2.1.mp3","WeWishYouAMerryChistmas_v.2.1/VODA_MUS_WEWISHU_Lead_v.2.1.mp3","VODA_MUS_WEWISHU_Midi_v.2.2.xml","Lyrics_WeWishYou.2.1.xml","Levels_test.xml"));
- //songs.push_back(new song("SilentNight/VODA_SilentNight_Backing_v.1.1.1.mp3","SilentNight/VODA_SilentNight_Melody_v.1.1.1.mp3","VODA_SilentNight_Midi_v.1.1.1.xml","Lyrics_WeWishYou.2.1.xml","Levels_WeWishYou.2.1.xml"));
+ songs.push_back(new song("SilentNight/VODA_SilentNight_Backing_v.1.1.1.mp3","SilentNight/VODA_SilentNight_Melody_v.1.1.1.mp3","VODA_SilentNight_Midi_v.1.1.3.xml","Lyrics_SilentNight_v1.1.3.xml","Levels_SilentNight_v1.1.3.xml"));
songs.push_back(new song("WeWishYouAMerryChistmas_v.2.1/VODA_MUS_WEWISHU_Backing_v.2.1.mp3","WeWishYouAMerryChistmas_v.2.1/VODA_MUS_WEWISHU_Lead_v.2.1.mp3","VODA_MUS_WEWISHU_Midi_v.2.2.xml","Lyrics_WeWishYou.2.1.xml","Levels_WeWishYou.2.1.xml"));
songs.push_back(new song("DeckTheHalls_v.4.0/VODA_MUS_DeckTheHalls-Backing_v.4.0.mp3","DeckTheHalls_v.4.0/VODA_MUS_DeckTheHalls-Lead_v.4.0.mp3","VODA_MIDI_DeckTheHalls-v.4.0.xml","Lyrics_DeckTheHalls.4.0.xml","Levels_DeckTheHalls.4.0.xml"));
songs.push_back(new song("DingDong.v.2.2/VODA_MUS_DingDong_Backing_v.2.2.mp3","DingDong.v.2.2/VODA_MUS_DingDong_Melody_v.2.2.mp3","VODA_MIDI_DingDong_v.2.2.xml","Lyrics_DingDong.2.2.xml","Levels_DingDong.2.2.xml"));
@@ -79,9 +79,10 @@ void testApp::setup(){
tags.push_back(new Tag("Tags/TAG_Level-2.png",3000,0.5,0));
tags.push_back(new Tag("Tags/TAG_Level-3.png",3000,0.5,0));
tags.push_back(new Tag("Tags/TAG_Level-4.png",3000,0.5,0));
- tags.push_back(new Tag("Tags/PreGame-Practice.png",6000,0.5,0.16667));
+ tags.push_back(new Tag("Tags/PreGame-Practice.png",7000,0.5,0.16667));
tags.push_back(new Tag("Tags/Game-Over.png",3000,0.5,0));
- tags.push_back(new Tag("Tags/Thanks-NEW.png",3000,0.5,0));
+ tags.push_back(new Tag("Tags/Thanks-NEW.png",4000,0.5,0));
+ tags.push_back(new Tag("Tags/TAG_Practice-Run.png",3000,0.5,0));
logos.push_back(new Billboard("Logo-VF.png",0.5,0.0));
@@ -125,7 +126,7 @@ void testApp::setup(){
background.setLoopState(OF_LOOP_NORMAL);
background.play();
- backgroundmusic.loadSound("VODA_MUS_Pre-Game-Music_v.1.1.mp3");
+ backgroundmusic.loadSound("VODA_SFX_PreGameMusic_v.2.0.mp3");
backgroundmusic.setLoop(true);
backgroundmusic.play();
backgroundmusic.setVolume(1.0);
@@ -304,9 +305,11 @@ void testApp::draw(){
case GAME_READY:
case GAME_STARTPLAYING:
case GAME_PRACTICE:
+ case GAME_PRACTICE2:
case GAME_PLAYING:
case GAME_ENDPLAYING:
case GAME_WALKON:
+ case GAME_ENDTITLE:
drawBackgroundLayers();
break;
case GAME_STARTINGADVERT:
@@ -375,6 +378,7 @@ void testApp::draw(){
}
break;
case GAME_INTRO:
+ case GAME_ENDTITLE:
ofEnableAlphaBlending();
seg=(((float)(ofGetElapsedTimeMillis()-segmentStartTime))*.001)/6;
if (seg<1.0f) {
@@ -383,6 +387,7 @@ void testApp::draw(){
}
break;
case GAME_PRACTICE:
+ case GAME_PRACTICE2:
ofEnableAlphaBlending();
missed=practiceSong.missedNote();
if (missed>-1) (*playanimal)[missed].playNow("Shudder");
@@ -423,7 +428,7 @@ void testApp::draw(){
}
- //draw tags and VF logo
+ //draw tags and logos
switch(gamestate) {
case GAME_STARTINGADVERT:
if (segamt<0.5) {
@@ -437,10 +442,14 @@ void testApp::draw(){
ofSetColor(255,255,255,((segamt-0.5)*510));
}
else break;
+ case GAME_ENDTITLE:
+ //DCC LOGO
+ logos[1]->draw((gridX[0]*ofGetHeight())+hOffs,gridY[1]*ofGetHeight(),scale);
case GAME_ENDINGINTRO:
case GAME_READY:
case GAME_STARTPLAYING:
case GAME_PRACTICE:
+ case GAME_PRACTICE2:
case GAME_PLAYING:
case GAME_ENDPLAYING:
case GAME_WALKON:
@@ -451,8 +460,9 @@ void testApp::draw(){
}
logos[0]->draw((gridX[0]*ofGetHeight())+hOffs,0,scale);
break;
+
}
- //draw banner, DCC logo and wirebirds
+ //draw banner and wirebirds
bannerscale=scale;
ofSetColor(255,255,255);
switch(gamestate) {
@@ -481,6 +491,7 @@ void testApp::draw(){
ofEnableAlphaBlending();
banner.draw(ofGetWidth()*0.5,0,bannerscale);
break;
+ case GAME_PRACTICE2:
case GAME_STARTPLAYING:
case GAME_PLAYING:
if (showWire) wirebirds.draw(ofGetWidth()/2,ofGetHeight()*birdpoint,scale);
@@ -494,8 +505,6 @@ void testApp::draw(){
banner.draw(ofGetWidth()*0.5,0,bannerscale);
break;
case GAME_WALKON:
- //DCC LOGO
- //logos[1]->draw((gridX[0]*ofGetHeight())+hOffs,gridY[1]*ofGetHeight(),scale);
bannerscale=scale*(0.675+(max(0.0,min(((float)(ofGetElapsedTimeMillis()-segmentStartTime))*.001,1.0))*0.325));
ofEnableAlphaBlending();
banner.draw(ofGetWidth()*0.5,0,bannerscale);
@@ -505,6 +514,9 @@ void testApp::draw(){
switch(gamestate) {
case GAME_ENDPLAYING:
case GAME_WALKON:
+ case GAME_ENDINGINTRO:
+ case GAME_INTRO:
+ case GAME_ENDTITLE:
if (ofGetWidth()>ofGetHeight()) {
float slice=(ofGetWidth()-ofGetHeight())/2;
ofSetColor(0,0,0);
@@ -548,6 +560,7 @@ void testApp::draw(){
break;
case GAME_STARTPLAYING:
case GAME_PRACTICE:
+ case GAME_PRACTICE2:
break;
case GAME_PLAYING:
backgroundmusic.setVolume(max(0.0,1.0-(segamt*2.0)));
@@ -596,20 +609,26 @@ void testApp::activateGame(){
songs[currentsong]->setTimeframe(timescale);
songs[currentsong]->setFlakeThresh(threshStart,threshEnd);
songs[currentsong]->setKeyThresh(keyThresh);
- songs[currentsong]->play();
+ songs[currentsong]->preRoll(2000);
tags[0]->play();
nextsong=(nextsong+1)%songs.size();
gamestate=GAME_PLAYING;
}
void testApp::activatePractice(){
segmentStartTime=ofGetElapsedTimeMillis();
- gamestate=GAME_PRACTICE;
currentlevel=0;
practiceSong.setTimeframe(timescale);
practiceSong.setFlakeThresh(threshStart,threshEnd);
practiceSong.setKeyThresh(keyThresh);
- practiceSong.preRoll(5000);
- tags[5]->play();
+ if (gamestate==GAME_READY) {
+ gamestate=GAME_PRACTICE;
+ practiceSong.preRoll(4000);
+ tags[8]->play();
+ } else {
+ gamestate=GAME_PRACTICE2;
+ practiceSong.preRoll(5000);
+ tags[5]->play();
+ }
}
void testApp::switchAnimals(){
if (playanimal==&raccoons) playanimal=&penguins;
@@ -623,6 +642,7 @@ void testApp::queueWalkOff(){
//penguins: start + 289 = 8.25
//raccoons: start + 280 = 7.17
for (int i=0;i<3;i++) {
+ (*playanimal)[i].clear();
(*playanimal)[i].playNow("Walk_start");
for (int j=0;j<9;j++) (*playanimal)[i].play("Walking");
}
@@ -672,7 +692,7 @@ void testApp::keyPressed(int key){
}
break;
case ' ':
- if (gamestate==GAME_PRACTICE) {
+ if (gamestate==GAME_PRACTICE||gamestate==GAME_PRACTICE2) {
activateGame();
}
break;
@@ -702,6 +722,14 @@ void testApp::keyPressed(int key){
gamestate=GAME_INTRO;
}
break;
+ case 'p':
+ if (gamestate==GAME_READY) {
+ segmentStartTime=ofGetElapsedTimeMillis();
+ queueWalkOff();
+ tags[7]->playEnd();
+ gamestate=GAME_ENDTITLE;
+ }
+ break;
case 'w':
if (gamestate==GAME_READY) {
segmentStartTime=ofGetElapsedTimeMillis();
@@ -720,7 +748,7 @@ void testApp::keyPressed(int key){
//loadanimals("Raccoons");
playanimal =&raccoons;
break;
- case 'p':
+ case 't':
//loadanimals("Penguins");
playanimal =&penguins;
break;