summaryrefslogtreecommitdiff
path: root/vfg/src/testApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vfg/src/testApp.cpp')
-rwxr-xr-xvfg/src/testApp.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/vfg/src/testApp.cpp b/vfg/src/testApp.cpp
index 7c596d0..986673c 100755
--- a/vfg/src/testApp.cpp
+++ b/vfg/src/testApp.cpp
@@ -32,9 +32,8 @@ void guiWindow::windowMoved(int x,int y){
//----------------------------------------------------------------------
void testApp::setup(){
-
- game.setup("1122");
- gamepoll=0;
+
+ game.setup("1122",2000); //Asterisk.cpp thread polls server every 2000ms
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"));
@@ -52,7 +51,7 @@ void testApp::setup(){
penguins[1].load("Penguin-Purple.xml");
penguins[2].load("Penguin-Green.xml");
-
+
// temp save time
for (int i=0;i<3;i++) raccoons.push_back(Animal());
raccoons[0].load("Raccoon-Blue.xml");
@@ -65,7 +64,7 @@ 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",3000,0.5,0));
+ tags.push_back(new Tag("Tags/PreGame-Practice.png",6000,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));
@@ -79,7 +78,7 @@ void testApp::setup(){
banner.setAnchorPercent(0.5,0.0);
banner.setFrameRate(50);
banner.play();
-
+
wirebirds.load("Birds-with-Wire/Birds-with-Wire_%05i.png",125);
wirebirds.setAnchorPercent(0.5,0.5);
wirebirds.setFrameRate(50);
@@ -94,7 +93,7 @@ void testApp::setup(){
//release: commented out: 436m 256m
//508fr 1.4s load in use: 836m 443m
-
+
//cd /home/tim/workspace/VFxmas/vfg/bin/data
//mount -t tmpfs -o size=64M tmpfs /RAM
//cp *.m* RAM
@@ -110,7 +109,7 @@ void testApp::setup(){
background.loadMovie("RAM/Background_v3.mp4");
background.setLoopState(OF_LOOP_NORMAL);
background.play();
-
+
backgroundmusic.loadSound("VODA_MUS_Pre-Game-Music_v.1.1.mp3");
backgroundmusic.setLoop(true);
backgroundmusic.play();
@@ -139,6 +138,7 @@ void testApp::setup(){
gui.add(ts.setup("timescale",timescale,0,10000,255));
keyThresh=1500;
gui.add(kT.setup("keythresh",keyThresh,0,4000,255));
+ gui.add(showWire.setup("birdwire",true));
ofxFenster* win=ofxFensterManager::get()->createFenster(0, 0, 200, 400, OF_WINDOW);
win->setWindowTitle("config");
@@ -176,10 +176,6 @@ void testApp::exit(){
//--------------------------------------------------------------
void testApp::update(){
int ret=game.update();
- if (ofGetElapsedTimeMillis()-gamepoll>5000) {
- game.requestStatus();
- gamepoll=ofGetElapsedTimeMillis();
- }
if (ret==1000) {
activatePractice();
}
@@ -262,7 +258,7 @@ void testApp::draw(){
float scale=ofGetHeight()/1080.0f;
float bannerscale,aspect,wOffs; //this old chestnut
float segamt=((float)(ofGetElapsedTimeMillis()-segmentStartTime)*2.0f)/fadelength; //same variable used in all segments
-
+
switch(gamestate) {
case GAME_STARTINGINTRO:
case GAME_INTRO:
@@ -335,11 +331,11 @@ void testApp::draw(){
wOffs=(ofGetHeight()-(ofGetWidth()*aspect))*0.5;
advert.draw(0,wOffs,ofGetWidth(),ofGetWidth()*aspect);
ofDisableAlphaBlending(); //may have been turned on during intro
-
+
break;
-
+
}
-
+
//draw game action
switch(gamestate) {
case GAME_STARTINGADVERT:
@@ -376,7 +372,7 @@ void testApp::draw(){
if (missed>-1) (*playanimal)[missed].playNow("Shudder");
int hit=practiceSong.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);
if (songs[currentsong]->isPlaying) {
@@ -423,7 +419,7 @@ void testApp::draw(){
case GAME_PRACTICE:
ofEnableAlphaBlending();
bannerscale=scale*(1.0f-(max(0.0,min(((float)(ofGetElapsedTimeMillis()-segmentStartTime))*.002,1.0))*0.325));
- wirebirds.draw(ofGetWidth()/2,ofGetHeight()*0.65,scale);
+ wirebirds.draw(ofGetWidth()/2,ofGetHeight()*0.6,scale);
segamt=1.0;
ofEnableAlphaBlending();
banner.draw(ofGetWidth()*0.5,0,bannerscale);
@@ -446,6 +442,7 @@ void testApp::draw(){
break;
case GAME_STARTPLAYING:
case GAME_PLAYING:
+ if (showWire) wirebirds.draw(ofGetWidth()/2,ofGetHeight()*0.6,scale);
bannerscale=scale*0.675;
ofEnableAlphaBlending();
banner.draw(ofGetWidth()*0.5,0,bannerscale);
@@ -530,7 +527,7 @@ void testApp::activatePractice(){
practiceSong.setTimeframe(timescale);
practiceSong.setFlakeThresh(threshStart,threshEnd);
practiceSong.setKeyThresh(keyThresh);
- practiceSong.play();
+ practiceSong.preRoll(5000);
tags[5]->play();
}
void testApp::switchAnimals(){