4.6: Introduction to Inheritance Part II – The Nature of Code

[ad_1]
This video covers looks at the code for inheritance in a particle system example.

Read along:

Help us caption & translate this video!


Posted

in

by

Tags:

Comments

One response to “4.6: Introduction to Inheritance Part II – The Nature of Code”

  1. P-YAN Avatar

    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

Your email address will not be published. Required fields are marked *