Coding Challenge #46.1: Asteroids with p5.js – Part 1

This video is Part 1 of a new Coding Challenge: the classic Atari video game Asteroids! In this video, I use JavaScript and HTML5 canvas with the p5.js library to program the ship and the asteroids.

This video is also part of a collaboration with YouTuber Siraj from Sirajology ( He will program a machine learning bot to play the Asteroids game.

Asteroids Part 2:
Link to Sirajology’s video: COMING SOON

Support this channel on Patreon:

Send me your questions and coding challenges!:


Asteroids original code:
Asteroids Code with community submitted features:
Play the game!

Links discussed in this video:
Asteroids on Wikipedia:
My Trigonometry and Polar Coordinates video:
Sirajology’s channel:

Source Code for the all Video Lessons:

For More Coding Challenges:
For an Introduction to Programming and p5.js:

Help us caption & translate this video!



Do NOT follow this link or you will be banned from the site!