Update sphero_multiple.litcoffee
Use the nicer class based syntax
This commit is contained in:
parent
3316c22ca7
commit
33f8a876a5
|
@ -12,9 +12,9 @@ already here:
|
|||
Cylon = require '..'
|
||||
|
||||
Since both of our Spheros are going to have faily similar behaviour, we can
|
||||
define a base object to hold their attributes:
|
||||
define a class to hold their attributes:
|
||||
|
||||
SpheroRobot =
|
||||
class SpheroRobot
|
||||
|
||||
We'll define the Sphero's connection sans port, which we'll add later.
|
||||
|
||||
|
@ -50,7 +50,7 @@ Now that the pieces are in place, we can start making our robots.
|
|||
|
||||
We'll make a new instance of `SpheroRobot`, and modify it.
|
||||
|
||||
robot = Object.create SpheroRobot
|
||||
robot = new SpheroRobot
|
||||
|
||||
Now we'll tell the robot what it's name is, and what it's connection port should
|
||||
be:
|
||||
|
|
Loading…
Reference in New Issue