Game & App Building

Mission 3: Respond to a Click

addEventListener("click", ...) runs your code every time the stage is clicked. Inside, event.clientX/clientY tell you where the click happened on the whole page — subtracting the canvas's own position gives you the click position relative to the stage itself.

Your turn

Open Coding Studio and make clicking do something different — move the shape, change its size, or log a message.

Open Coding Studio
Ask JARVIS for a hint