tubeshowcaseโ—987,224 videosโ™ก My collection 0
โ† Learn to Code

Learn to Code40:45

Coding Challenge 5: Space Invaders in JavaScript with p5.js

The Coding Train โ†—

From the creator

This is my attempt to make a Space Invaders type game in the browser with JavaScript and the p5.js library Code: https://thecodingtrain.com/challenges/5-space-invaders ๐Ÿ•น๏ธ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/Azip-ZzXI ๐ŸŽฅ Previous video: https://youtu.be/KkyIDI6rQJI?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH ๐ŸŽฅ Next video: https://youtu.be/jxGS3fKPKJA?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH ๐ŸŽฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH Videos: ๐Ÿš‚ Classes in JavaScript: https://youtu.be/T-HGdc8L-7w ๐Ÿ”ด Coding Train Live 33: https://youtu.be/WpUnYfVmKdA?t=1192s Related Coding Challenges: ๐Ÿš‚ #46 Asteroids: https://youtu.be/hacZU523FyM ๐Ÿš‚ #72 Frogger: https://youtu.be/giXV6xErw0Y Timestamps: 00:00 Welcome to the challenge! 00:46 Setup the sketch canvas 01:22 Planning the game 02:00 Create a Ship constructor 04:20 Add keyboard interaction to move the ship 07:35 Create a Flower constructor 09:37 Create an array of Flowers 12:35 Create a Water Drop constructor 16:00 Create an array of drops 16:55 Create a drop object on key press 18:02 Start the drop at the ship's location 19:40 Check for intersection of water drop and flower 25:00 Grow the flower and remove the drop 30:40 Some improvements 31:20 Move the flowers 37:12 Improve keyboard interaction 40:00 Thanks for watching! Editing by Mathieu Blanchette Animations by Jason Heglund Music from Epidemic Sound ๐Ÿš‚ Website: http://thecodingtrain.com/ ๐Ÿ‘พ Share Your Creatio

Published 2016-04-26 ยท Watch on YouTube โ†—
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code