← HomeCREATOR PATH🦸

Super Bot Factory

19 / 20
🎯 Today's missions
πŸ¦ΈπŸ€–
SUPERHERO CITY

Super Bot Factory

Blueprint Lab taught you to stamp many robots from one class. Today, build a new blueprint on top of it. The child class inherits the robot's skills, then adds a superpower of its own!

🧬 Inheritance: code with a family tree

A child class can inherit properties and methods from a parent class. That means less repeated code and specialized objects that still share the same foundation.

extends
Connects the child blueprint to its parent.
super()
Runs the parent's constructor first.
Inherited method
speak() works without rewriting it.
Override
A child replaces a method with its own version.

Think of it as: Robot β†’ SuperBot. Every SuperBot is a Robot, but not every Robot has a jetpack!

super-bot-factory.jsLIVE CODE

βš™οΈ Design a child class instance

Choose a power, then build!
πŸ™οΈ Superhero City PreviewOUTPUT
Your super squad will land here! πŸ™οΈ
> Factory ready. Build a child class instance...
0SUPER BOTS
0INHERITED SPEAKS
0POWER MOVES

πŸ† Factory challenges

1

Extend the blueprint

Build your first JetBot child instance.

2

Prove inheritance

Use the inherited speak() method.

3

Specialize the child

Trigger a power method unique to the child class.

4

Build a class family

Create two different child-class types.

5

Override the move

Train three bot types and compare their custom moves.

πŸ“š What you learned

πŸ†

Super Squad Certified!

You built a family of classes without copying the parent blueprint.

βœ… extends links parent and child classes

βœ… super() initializes inherited data

βœ… inherited methods are ready to use

βœ… specialized and overridden methods make each child unique

Come back for Lesson 20: Code Explorer Command Center!
Combine classes, APIs, async code, and error handling in the final capstone mission. πŸŒπŸš€