Module 5.4 — Writing Your Own Classes
Quarter 2 · Weeks 16 · Environment: shplay
Lessons in this module
Estimated: ~4 hr 42 min
- Reading5.4.1Reading — Methods: functions that live on a class~6 min
- shPlay Lesson5.4.2Lab — Method with no params~8 min
- shPlay Lesson5.4.3Lab — Method with parameters~8 min
- shPlay Lesson5.4.4Lab — Method that returns a value~8 min
- shPlay Lesson5.4.5Lab — A method calling this.otherMethod()~8 min
- Assignment5.4.6Chart the Code — A Method That Calls a Method~20 min
- Reading5.4.7Reading — Why this.sprite, not extends Sprite~6 min
- shPlay Lesson5.4.8Lab — Mutate this.sprite.x from a method~8 min
- shPlay Lesson5.4.9Lab — Cleanup with this.sprite.delete()~6 min
- Worked Example5.4.10Worked Example — Write an Enemy class (integration)~15 min
- shPlay Lesson5.4.11Lab — Three Enemies in three variables~6 min
- shPlay Lesson5.4.12Lab — An array of Enemies~8 min
- shPlay Lesson5.4.13Lab — Loop over an array of instances~8 min
- Reading5.4.14Reading — Parallel Arrays vs Classes~10 min
- Worked Example5.4.15Worked Example — Procedural vs OOP side-by-side~15 min
- Reading5.4.16Read the Charts — Three Variables or Three Objects~15 min
- Reading5.4.17Reading — When to reach for OOP (3-question checklist)~6 min
- Assignment5.4.18Collectible Class~45 min
- Assignment5.4.19Procedural vs OOP Writeup~40 min
- Reading5.4.20Reading — Encapsulation, inheritance, polymorphism (vocabulary only)~6 min
- Challenge5.4.21Challenges~30 min