4.3: Particle Systems with Inheritance - The Nature of Code

4.3: Particle Systems with Inheritance - The Nature of Code

Subscribers:
1,750,000
Published on ● Video Link: https://www.youtube.com/watch?v=44RSr49m6LU



Duration: 6:21
33,061 views
784


Have you ever wondered how the concepts of inheritance and polymorphism fit into the Nature of Code Particle system examples in p5.js? Code: https://thecodingtrain.com/tracks/the-nature-of-code-2/noc/4-particles/3-particle-inheritance

πŸ•ΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/vYgv7Xagg

πŸŽ₯ Previous: https://youtu.be/8a5BkwuZRK0?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
πŸŽ₯ Next: https://youtu.be/pUhv2CA0omA?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM
πŸŽ₯ All: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZV4yEcW3uDwOgGXKUUsPOM

Other videos mentioned in this video:
πŸŽ₯ Inheritance in JavaScript: https://youtu.be/MfxBfRD0FVU
πŸŽ₯ Polymorphism in JavaScript: https://youtu.be/8a5BkwuZRK0

Timestamps:
0:00 Hi!
0:27 Make particle extend p5.Vector.
1:23 Let's make a class that extends Particle.
2:52 Javascript file order matters, sometimes.
3:26 We need to use the Confetti class.
4:00 What if we want both confetti and particles.
4:32 Some exercises you could try.
4:47 When might you want to extend a class?
5:52 What's next?

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 Topics: https://github.com/CodingTrain/Suggestion-Box
πŸ’‘ GitHub: https://github.com/CodingTrain
πŸ’¬ Discord: https://thecodingtrain.com/discord
βœͺ Nebula: https://go.nebula.tv/codingtrain
πŸ’– Membership: http://youtube.com/thecodingtrain/join
πŸ›’ Store: https://standard.tv/codingtrain
πŸ–‹οΈ Twitter: https://twitter.com/thecodingtrain
πŸ“Έ Instagram: https://www.instagram.com/the.coding.train/

πŸŽ₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
πŸŽ₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

πŸ”— p5.js: https://p5js.org
πŸ”— p5.js Web Editor: https://editor.p5js.org/
πŸ”— Processing: https://processing.org

πŸ“„ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct