Error moving object (using quad())

You can also say

if(mousePressed)
noLoop();

if(keyPressed)
loop();

Both in draw() function

2 Likes