6.3.5 Cmu Cs Academy (Complete)

Using centerX , centerY , and rotateAngle within a repeating loop.

In the "Continuous Cartwheels" version (6.3.5), the objective is to make a stick person move horizontally while rotating.

Example: if (icon.right >= 400 or icon.left <= 0): icon.dx *= -1 . 6.3.5 Cmu Cs Academy

This function runs automatically multiple times per second. You must update the centerX and rotateAngle of your person here. person.centerX += 5 (moves the person right) person.rotateAngle += 10 (rotates the person)

If the person moves off the screen, you need code to reset them to the beginning or reverse their path. Common Pitfalls and Solutions Using centerX , centerY , and rotateAngle within

To make an object bounce, you must check its edges against the canvas width/height.

If you are moving a complex character, ensure all parts are in a single Group . If you only move one part, the stick figure will "fall apart" as it moves. Why This Lesson Matters You must update the centerX and rotateAngle of

Unit 6 is a turning point in the CMU CS Academy curriculum. It shifts from static drawings to . Mastering 6.3.5 proves you can handle multiple variables changing at once—a fundamental skill for game development and advanced simulation.

Many students struggle with the variation of 6.3.5, where an icon must "bounce" off the walls.