summaryrefslogtreecommitdiff
path: root/vfg/src/testApp.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@gray.(none)>2012-11-13 00:16:01 +0000
committerTim Redfern <tim@gray.(none)>2012-11-13 00:16:01 +0000
commit27b7b4c5ce0102c6089cd0b6cc58096b0c5ccf36 (patch)
treefe678a6215a87fd3ae384b39a8256086ddf3b029 /vfg/src/testApp.cpp
parent91ff35dff6ae35943d8f1132652e426f88c98592 (diff)
penguin sprites
Diffstat (limited to 'vfg/src/testApp.cpp')
-rwxr-xr-xvfg/src/testApp.cpp35
1 files changed, 32 insertions, 3 deletions
diff --git a/vfg/src/testApp.cpp b/vfg/src/testApp.cpp
index dc450a2..52f2a3a 100755
--- a/vfg/src/testApp.cpp
+++ b/vfg/src/testApp.cpp
@@ -2,9 +2,9 @@
//--------------------------------------------------------------
void testApp::setup(){
-
+
//for (float i=0;i<1.2;i+=0.1) printf("%f in level %i bound %f\n",i,lives->getLevel(i),lives->getLowerBound(lives->getLevel(i)));
-
+
testsong=new song("VODA_MUS_DeckTheHalls-Backing_v.1.5.mp3","VODA_MUS_DeckTheHalls-Melody_v.1.5.mp3","MIDI_DeckTheHalls_MIDI.1.5.xml","Lyrics_DeckTheHalls.1.5.xml","Levels_DeckTheHalls.1.5.xml");
testsong->setTimeframe(2500);
testsong->setFlakeThresh(1000,100);
@@ -12,6 +12,23 @@ void testApp::setup(){
ofSetBackgroundAuto(false);
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());
+ penguins[0].load("Penguin-Clap-Blue/Penguin-Clap-Blue_%05i.png",20);
+ penguins[0].setAnchorPercent(0.5, 1.0);
+ penguins[0].setFrameRate(50);
+ penguins[0].setLoop(false);
+ penguins[1].load("Penguin-Clap-Purple/Penguin-Clap-Purple_%05i.png",20);
+ penguins[1].setAnchorPercent(0.5, 1.0);
+ penguins[1].setFrameRate(50);
+ penguins[1].setLoop(false);
+ penguins[2].load("Penguin-Clap-Green/Penguin-Clap-Green_%05i.png",20);
+ penguins[2].setAnchorPercent(0.5, 1.0);
+ penguins[2].setFrameRate(50);
+ penguins[2].setLoop(false);
+
+ printf("blue clap: %i\n",penguins[0].getTotalFrames());
}
void testApp::exit(){
@@ -20,18 +37,29 @@ void testApp::exit(){
//--------------------------------------------------------------
void testApp::update(){
+
+ for (int i=0;i<3;i++) {
+ penguins[i].update();
+ }
+
+
}
//--------------------------------------------------------------
void testApp::draw(){
ofEnableAlphaBlending();
//ofBackground(0,0,0,0.1);
- ofSetColor(0,0,0,50);
+ ofSetColor(0,0,0,100);
ofRect(0,0,ofGetWidth(),ofGetHeight());
ofSetColor(255,255,255);
+ testsong->drawNotes();
+ ofSetColor(255,255,255);
+ for (int i=0;i<3;i++) penguins[i].draw((i*300)+100,800);
testsong->draw();
if (!testsong->isPlaying) ofDrawBitmapString("game over!", (ofGetWidth()/2)-25,(ofGetHeight()/2)-5);
+
+
}
//--------------------------------------------------------------
@@ -44,6 +72,7 @@ void testApp::keyPressed(int key){
case '2':
case '3':
testsong->playerControl(key-'0');
+ penguins[key-'1'].play();
break;
}