Loading…

Level Up: creative coding with p5.js - part 2

In this session, we will turn our static drawings into animations!

Article hero image

In this session, we will turn our static drawings into animations! We will animate the positions of shapes using the draw() function by incrementing and decrementing values over time.

Together, we will work on the Bouncing Balls project on the Codecademy platform. Using p5.js animation techniques, arrays and for-loops, we will create an animation of circles bouncing around the canvas. We will also look at how to randomize the position, speed, size, and color of each bouncing ball using arrays.

Here are some Stack Overflow questions related to the work we did in today's session:

Conditional statement not activated for bouncing ball in p5.js

P5 - bouncing ball from left to right and back

Using the random() function in p5.js

If you enjoyed this lesson, you can catch up on the rest of the series on YouTube. If you’d like to watch a session live, follow the Codecademy YouTube channel.

Every Tuesday from now until April 27th, we’ll be streaming a new session at 4PM EST. You can set a reminder for the stream for March 23rd here.

Finally, if you want even more Creative Coding with p5.js content, you can sign up for the interactive course this series was based on here. This course was developed by Jiwon and has many more quizzes, projects, and helpful articles that we can’t fit into our streams!

Login with your stackoverflow.com account to take part in the discussion.