In p5, make a rectangle that follows your mouse.
Like this:
I think you can see where this is going...
Weβre going to build a version of pong, one of the first computer games.
β± Pretend youβre talking to the ball. How should it move?
β± What about the paddles. How should they move?
β± Redo your pseudocode, using x
, y
, windowWidth
, and windowHeight
.
β± How did writing pseudocode change how your wrote p5 code?
π― Learning Targets |
---|
I can write the pseudcode for pong. |
I can use built-in variables to make a paddle follow my mouse. |
I can write p5 comments to explain my iteration and thinking. |
Next timeβ¦