ImagePan::ImagePan() { name = "Image Pan"; parameters.setName(name + baseName); //parameters.add(imagename.set()); parameters.add(pan_speed.set("Pan speed", 1000,500,3000)); ofxKeyframeAnimRegisterEvents(this); }
//-------------------------------------------------------------- void testApp::setup(){ ofSetLogLevel(OF_LOG_VERBOSE); ofSetWindowShape(800, 800); ofSetVerticalSync(true); //ofSetFrameRate(60); width = ofGetWidth(); height = ofGetHeight(); cam.enableOrtho(); cam.setAspectRatio(width/height); cam.setNearClip(1.0f); cam.setFarClip(100.0f); ofSetBackgroundColor(195,188, 160); bpm = 128.0f; // setup startup state // menu mode enabled ofxKeyframeAnimRegisterEvents(this); // --------- // game startup for dev ofNode* gt = grid.getGameObject(); ofVec3f pos = gt->getPosition(); pos.z = -50.0f; gt->setPosition(pos); // --------- music.setBPM(bpm); music.loadMusic(); music.startGameMusic(); grid.setBPM(bpm); gPosX = cam.getGlobalPosition().x; gPosY = cam.getGlobalPosition().y; player.setGrid(&grid); player.setBPM(bpm); //player.startAnimation(); msBetweenBeats = (60.0f/bpm) * 1000.0; controlLock = false; beats.addToKeyFrame(Playlist::Action::event(0.0f, this, "beat")); }
Player::Player(){ playerMoved = true; interuptTime = 0.0f; rotateDirection = 1.0f; depth = -50.0f; xyScale = 2.0f; h.setScale(100.0f, 100.0f, 1.0f); h.setPos(0.0, 0.0, depth); h.setColor(ofColor(200, 120,120)); headingTri.setPosition(0.6, 0.0, 1.0); headingTri.setScale(0.2, 0.2, 1.0); headingTri.setParent(*h.getTransform()); gameObject.setPosition(0.0, 0.0, 0.0); gameObject.setOrientation(ofVec3f(1.0f, 0.0f, 0.0f)); h.getTransform()->setParent(gameObject); zRotDeg = 45.0f; gPosX = gameObject.getGlobalPosition().x; gPosY = gameObject.getGlobalPosition().y; ofxKeyframeAnimRegisterEvents(this); }