6.3.5 Cmu Cs Academy -

Unlike text-based problems on LeetCode or Codecademy, CMU CS Academy asks you to build shapes, animate objects, and respond to user input (mouse clicks and keyboard presses) within a 400x400 canvas. Unit 6 changes everything. In earlier units, code runs top-to-bottom and stops. In Unit 6, you write event handlers —functions that sit dormant until a specific action occurs.

# 6.3.5 - Moving Circle with Arrow Keys # CMU CS Academy Solution circle = None 6.3.5 Cmu Cs Academy

def onKeyPress(key): circle.centerX += 15 # Error: circle is not defined Unlike text-based problems on LeetCode or Codecademy, CMU

Happy coding, and may your keypresses always be detected! This article is part of a series on CMU CS Academy exercise solutions. For help with 6.3.6, 6.4.1, or the final project, check out the related guides. In Unit 6, you write event handlers —functions