
4.3: Particle Systems with Inheritance - The Nature of Code
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