0

I have created the image of a dinosaur in openprocessing.org using multiple lines of code. I want to move the dinosaur around the environment as a whole, but moveMouse fn only lets me use one shape at a time. Any advice?

3
  • could you add some code to your question please? May 4, 2022 at 10:27
  • use the translate(50, 50); function in your mouse move May 4, 2022 at 10:32
  • Please provide enough code so others can better understand or reproduce the problem.
    – Community Bot
    May 4, 2022 at 12:17

1 Answer 1

0

use the translate function in conjunction with the mouseX/Y vars

function setup() {
    createCanvas(windowWidth, windowHeight);
    background(100);
}

function draw() {
    background(100); // Set background
    translate(mouseX, mouseY); // translate
    circle(0, 0, 20); // draw here
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.