PImage star; void setup() { frameRate(10); background(17, 7, 76); size(400, 400); star= loadImage("Star.png"); } void draw() { float speed = dist(mouseX, mouseY, pmouseX, pmouseY); if (mousePressed == true) { if (mouseButton == LEFT) { image(star, mouseX, mouseY, 30, 30); } if (mouseButton == RIGHT) { image(star, mouseX, mouseY+10, 15, 15); image(star, mouseX+20, mouseY+17, 15, 15); image(star, mouseX+12, mouseY+25, 15, 15); } } if (mousePressed == false) { image(star, mouseX+10, mouseY+10, 5, 5); image(star, mouseX+25, mouseY+47, 5, 5); image(star, mouseX+45, mouseY+37, 5, 5); image(star, mouseX+20, mouseY+39, 5, 5); } }
In looking at the code, it doesn’t look like you’re using the “speed” variable. It would be better to comment it out in that case or delete it. Please think about have the star draw from the center of the cursor, rather offset to the right.
it’s nice that you made the mouseClicked shape so interesting, i just used standard ovals
Your email is never published nor shared. Required fields are marked *
2 Comments
In looking at the code, it doesn’t look like you’re using the “speed” variable. It would be better to comment it out in that case or delete it. Please think about have the star draw from the center of the cursor, rather offset to the right.
it’s nice that you made the mouseClicked shape so interesting, i just used standard ovals