Created
May 7, 2024 06:30
-
-
Save tado/92b73d8e873dcc6b08489933f608b868 to your computer and use it in GitHub Desktop.
openFrameworks Animation Basic Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
void ofApp::setup() { | |
locationX = ofGetWidth() / 2.0; | |
locationY = ofGetHeight() / 2.0; | |
velocityX = ofRandom(-10, 10); | |
velocityY = ofRandom(-10, 10); | |
} | |
void ofApp::update() { | |
locationX += velocityX; | |
locationY += velocityY; | |
} | |
void ofApp::draw() { | |
ofSetColor(255); | |
ofDrawCircle(locationX, locationY, 20); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include "ofMain.h" | |
class ofApp : public ofBaseApp { | |
public: | |
void setup(); | |
void update(); | |
void draw(); | |
float locationX; | |
float locationY; | |
float velocityX; | |
float velocityY; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment