Inside the onStep() function, you update the object's position by adding these dx and dy values to its current center coordinates. icon.centerX += icon.dx icon.centerY += icon.dy 3. Implement Boundary Bouncing
Summary
It's a typical Monday morning for Rohan, a junior from California, who's enrolled in the CMU CS Academy's online course, "Introduction to Computer Science." Rohan wakes up early, grabs a cup of coffee, and logs into his computer. He opens his web browser and navigates to the course website, where he checks the daily schedule and assignments. 6.3.5 Cmu Cs Academy
The of the 6.3.5 exercise you are working on Inside the onStep() function, you update the object's
'up' (lowercase, no 'arrow' prefix).
"Create a blue circle with a radius of 20 at position (200, 200). Use the onKeyPress handler to move the circle left, right, up, and down when the corresponding arrow keys are pressed. The circle should move 15 pixels per key press." He opens his web browser and navigates to
Tip: Remember that if you want to modify a global variable inside a function, you must declare it using the global keyword at the start of that function. Step 5: Test and Debug