Object oriented programming
6.2: Classes in JavaScript with ES6 - p5.js Tutorial
Code for this video.
Object oriented programming:
Think about your objects as having data and things it can do.
For example, a bubble can move and be displayed.
Create objects and issue commands on them.
Concepts in this video:
Encapsulation: Describe everything it means to be a bubble inside the object.
Class: a template, cookie cutter, or a blueprint for being a bubble.
New: creates an instance of the object (this is the cookie); constructs an object
Functions become part of the object (ie pop, float)
Data AND Functionality are combined into an object.
Code for this video.
Object oriented programming:
Think about your objects as having data and things it can do.
For example, a bubble can move and be displayed.
Create objects and issue commands on them.
Concepts in this video:
Encapsulation: Describe everything it means to be a bubble inside the object.
Class: a template, cookie cutter, or a blueprint for being a bubble.
New: creates an instance of the object (this is the cookie); constructs an object
Functions become part of the object (ie pop, float)
Data AND Functionality are combined into an object.