[ad_1]
This video covers looks at the code for inheritance in a particle system example.
Read along:
Help us caption & translate this video!
[ad_1]
This video covers looks at the code for inheritance in a particle system example.
Read along:
Help us caption & translate this video!
by
Tags:
Just for reference here is a link to the code for P5,JS –https://github.com/shiffman/The-Nature-of-Code-Examples-p5.js/blob/master/chp04_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/confetti.js
The syntax is different, I don't really understand it but copied it otherwise. Its interesting that this code is put at the bottom of the Class code outside all curly brackets! Note that Confetti replaced the name SquareParticle;
Confetti.prototype = Object.create(Particle.prototype);
Confetti.prototype.constructor = Confetti;
Leave a Reply