tubeshowcase●1,059,698 videos♡ My collection 0
← Learn to Code

Learn to Code31:55

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

The Coding Train ↗

From the creator

In this two part coding challenge, I use the p5.js library to create my own version of the classic Atari video game Asteroids! Code: https://thecodingtrain.com/challenges/46-asteroids 🕹️ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/VtYr6E4_M 🎥 Next video: https://youtu.be/JUDYkxU6J0o?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH 🎥 All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH References: 🔗 Asteroids on Wikipedia: https://en.wikipedia.org/wiki/Asteroids_(video_game) Videos: 🎥 Asteroids Part 2: https://youtu.be/xTTuih7P0c0 🎥 Polar Coordinates: https://youtu.be/O5wjXoFrau4 🎥 Livestream Archive: https://youtu.be/VFnF87-JNtY Related Coding Challenges: 🚂 #81 Circle Morphing: https://youtu.be/u2D4sxh3MTs Timestamps: 0:00 Introducing today's topic: coding the classic Atari game Asteroids 1:54 Create a Ship object 5:56 Write a function to turn the ship 9:54 Move the ship by adding velocity and acceleration vectors 16:51 Deal with the edges of the screen 19:32 Create an array of asteroids 22:12 Add push and pop to save the ship's heading 24:41 Use polar to cartesian coordinates to get the vertices on the asteroids 27:52 Offset the vertices by a random value to create jagged asteroids 30:05 Move the asteroids Editing by Mathieu Blanchette Animations by Jason Heglund Music from Epidemic Sound 🚂 Website: http://thecodingtrain.com/ 👾 Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide 🚩 Suggest To

Published 2016-12-15 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code