diff options
| author | Tim Redfern <tim@gray.(none)> | 2012-11-20 04:46:42 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@gray.(none)> | 2012-11-20 04:46:42 +0000 |
| commit | b4d89c0a9029739d2af1705b371dc28f27b6d2dc (patch) | |
| tree | 5df34978c29ca28f5c2d01d8694f83f44cdc848f /vfg/src/testApp.cpp | |
| parent | 891b71c261a4571e0e0ba0e824e1bdb2478e0c65 (diff) | |
puppet penguins
Diffstat (limited to 'vfg/src/testApp.cpp')
| -rwxr-xr-x | vfg/src/testApp.cpp | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/vfg/src/testApp.cpp b/vfg/src/testApp.cpp index ddc5cfe..8dd6110 100755 --- a/vfg/src/testApp.cpp +++ b/vfg/src/testApp.cpp @@ -13,7 +13,12 @@ void testApp::setup(){ ofBackground(0,0,0); //printf("%s\n",ofVAArgsToString("Penguin-Clap-Blue_00000.png", 1).c_str()); ??? - for (int i=0;i<3;i++) penguins.push_back(ofxSprite()); + for (int i=0;i<3;i++) penguins.push_back(Animal()); + penguins[0].load("Penguin-Blue.xml"); + penguins[1].load("Penguin-Purple.xml"); + penguins[2].load("Penguin-Green.xml"); + + /* penguins[0].load("Penguin-Clap-Blue/Penguin-Clap-Blue_%05i.png",20); penguins[0].setAnchorPercent(0.5, 1.0); penguins[0].setFrameRate(50); @@ -26,19 +31,20 @@ void testApp::setup(){ penguins[2].setAnchorPercent(0.5, 1.0); penguins[2].setFrameRate(50); penguins[2].setLoop(false); + */ //printf(ofSystem("ls -la").c_str()); - + //testpenguin.load("Penguin-Blue.xml"); //debug: commented out: 436m 257m //508fr 1.7s load in use: 837m 444m - + //release: commented out: 436m 256m //508fr 1.4s load in use: 836m 443m - - + + showFPS=false; - + } void testApp::exit(){ @@ -53,7 +59,7 @@ void testApp::update(){ } else if (ret>0) { testsong->playerControl(ret); - penguins[ret-1].play(); + penguins[ret-1].playNow("Clap"); } for (int i=0;i<3;i++) { penguins[i].update(); @@ -66,20 +72,22 @@ void testApp::draw(){ //ofBackground(0,0,0,0.1); ofSetColor(0,0,0,100); ofRect(0,0,ofGetWidth(),ofGetHeight()); - + if (testsong->isPlaying) { ofSetColor(255,255,255); testsong->drawNotes(); + int missed=testsong->missedNote(); + if (missed>-1) penguins[missed].playNow("Shudder"); } ofSetColor(255,255,255); - for (int i=0;i<3;i++) penguins[i].draw((i*300)+100,800); + for (int i=0;i<3;i++) penguins[i].draw((i*300)+100,600); if (testsong->isPlaying) { ofSetColor(255,255,255); testsong->draw(); } else ofDrawBitmapString("game over!", (ofGetWidth()/2)-25,(ofGetHeight()/2)-5); - - if (showFPS) ofDrawBitmapString(ofToString(ofGetFrameRate()), 10,ofGetHeight()-20); + + if (showFPS) ofDrawBitmapString(ofToString(ofGetFrameRate()), ofGetWidth()-50,ofGetHeight()-15); } @@ -95,12 +103,12 @@ void testApp::keyPressed(int key){ case '2': case '3': testsong->playerControl(key-'1'); - penguins[key-'1'].play(); + penguins[key-'1'].playNow("Clap"); break; - case 's': + case 's': game.startGame(); break; - case 'f': + case 'f': showFPS=!showFPS; break; } |
