I am trying to make a quick experiment. I created a class that generates a random sized circles every time you click the screen. I want to implement connecting the circles to one other once they're on screen. So far I've managed to connect them to the center one but I want to implement a connection amongst them all or at least the previous one.
I tried doing pmouseX, pmouseY as I thought this location might only get saved on click since I put it inside the mouseReleased function. Now I know that it's always updating!
Any thoughts? Here's my code, thanks and happy thanksgiving!
ArrayList circleCollection;
int originX = 400;
int originY = 250;
float prevX, prevY;
void setup(){
size(800,500);
smooth();
frameRate(30);
//DEFINE ARRAY LIST
circleCollection = new ArrayList();
}
void draw(){
background(240);
fill(0);
for(int i = 0; i < circleCollection.size(); i++){
Circle myCircle = (Circle) circleCollection.get(i);
myCircle.display();
}
ellipse(originX, originY, 10,10);
}
void mouseReleased(){
Circle myCircle = new Circle(mouseX, mouseY, random(1,10), pmouseX, pmouseY);
I'm trying to loop through the colors of an array so that as you hold the mouse and drag the sketch will generate a new circle using the next set of values of the array. I am using three arrays (R,G,B). Here's my code!
Very first post here! I just started messing around with processing for android over the weekend and made a really simple drawing app that I'll be adding features to as a way to learn more about android app development with processing.
The app I made is a real simple drawing app that generates random color circles as you drag your finger across the screen and would like to add the feature to set that image as a background once you're done drawing.
Here's a screenshot of how the app looks on the phone (running on Galaxy Nexus).
Any guidance/feedback would be awesome. I made the app thinking of my daughter and she loved it, she actually made that drawing.