From f4719e4e997a05bb423e9ca691de50bcbf1cb375 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 5 Nov 2012 11:35:50 +0000 Subject: flake interaction --- vfg/src/testApp.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'vfg/src/testApp.cpp') diff --git a/vfg/src/testApp.cpp b/vfg/src/testApp.cpp index 675baef..2a67d8f 100755 --- a/vfg/src/testApp.cpp +++ b/vfg/src/testApp.cpp @@ -25,16 +25,36 @@ void testApp::draw(){ ofSetColor(0,0,0,100); ofRect(0,0,ofGetWidth(),ofGetHeight()); if (testsong->isPlaying) testsong->draw(); + else { + ofSetColor(255,255,255); + ofDrawBitmapString("game over!", (ofGetWidth()/2)-25,(ofGetHeight()/2)-5); + } } //-------------------------------------------------------------- void testApp::keyPressed(int key){ + switch (key) { + case '0': + if (!testsong->isPlaying) testsong->preRoll(250); + break; + case '1': + case '2': + case '3': + testsong->playerControl(key-'0'); + break; + } } //-------------------------------------------------------------- void testApp::keyReleased(int key){ - + switch (key) { + case '1': + case '2': + case '3': + testsong->playerControl(0); + break; + } } //-------------------------------------------------------------- -- cgit v1.2.3