Loading...
「ツール」は右上に移動しました。
利用したサーバー: wtserver2
1055いいね 60808回再生

Coding Challenge #46.2: Asteroids with p5.js - Part 2

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: thecodingtrain.com/challenges/46-asteroids

🕹️ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/sketches/VtYr6E4_M

🎥 Next video:    • Coding Challenge #47: Pixel Sorting in Pro...  
🎥 All videos:    • Coding Challenges  

References:
🔗 Asteroids on Wikipedia: en.wikipedia.org/wiki/Asteroids_(video_game)

Videos:
🎥 Asteroids Part 1:    • Coding Challenge #46.1: Asteroids with p5....  
🎥 Polar Coordinates:    • 3.4 Polar Coordinates - The Nature of Code  
🎥 Livestream Archive:    • Live Stream #70: Coding Challenges: Astero...  

Related Coding Challenges:
🚂 #81 Circle Morphing:    • Coding Challenge #81.1: Circle Morphing - ...  

Timestamps:
0:00 Asteroids - Part 2
0:49 Add a Laser object
7:13 Add collision detection
11:44 Add a breakup function
15:38 Loop through the asteroids backwards
19:38 Use concat to add the new asteroids to the array
22:47 Remove the asteroids if their size falls below a threshold value
24:13 Check if the ship hits the asteroid
26:03 Possibilities for variations
27:00 Remove lasers that are offscreen

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

🚂 Website: thecodingtrain.com/
👾 Share Your Creation! thecodingtrain.com/guides/passenger-showcase-guide
🚩 Suggest Topics: github.com/CodingTrain/Suggestion-Box
💡 GitHub: github.com/CodingTrain
💬 Discord: discord.gg/hPuGy2g
💖 Membership: youtube.com/thecodingtrain/join
🛒 Store: standard.tv/codingtrain
🖋️ Twitter: twitter.com/thecodingtrain
📸 Instagram: www.instagram.com/the.coding.train/

🎥 Coding Challenges:    • Coding Challenges  
🎥 Intro to Programming:    • Start learning here!  

🔗 p5.js: p5js.org/
🔗 p5.js Web Editor: editor.p5js.org/
🔗 Processing: processing.org/

📄 Code of Conduct: github.com/CodingTrain/Code-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecodingtrain.com/issues/n…

#atariasteroids #polartocartesiancoordinates #p5js #javascript

コメント