Skip to content

Instantly share code, notes, and snippets.

@kenjiSpecial
Created March 19, 2013 10:09
Show Gist options
  • Save kenjiSpecial/5194964 to your computer and use it in GitHub Desktop.
Save kenjiSpecial/5194964 to your computer and use it in GitHub Desktop.
easy ball.h file for openFrameworks.
#import "ofMain.h"
class Ball{
public:
ofPoint pos;
ofColor col;
ofColor touchCol;
bool bDragged;
void init(){
pos.set(200, 200);
col.set(100, 100, 100, 255);
touchCol.set(255, 0, 0,255);
bDragged = false;
ofLog() << "init";
}
void draw_ball(){
// ofLog() << "call";
if (bDragged){
ofSetColor(touchCol);
ofCircle(pos, 100);
}else{
ofSetColor(col);
ofCircle(pos, 30);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment