logo

Crowdly

Browser

Add to Chrome

Given the following code, which statement should be added to draw() so that the ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Given the following code, which statement should be added to draw() so that the square keeps re-entering from the left side once it leaves the canvas on the right?

let squareX = 0;

function setup() {

  createCanvas(400, 300);

}

function draw() {

  background(200, 200, 200);

  rect(squareX, 150, 20, 20);

  squareX = squareX + 2;

}

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on elearning.aua.am?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome