Better class oriented code
This commit is contained in:
parent
a7d4a9d300
commit
6999236fe0
|
@ -10,7 +10,7 @@ bots = [
|
|||
Green = 0x0000FF
|
||||
Red = 0xFF0000
|
||||
|
||||
ConwayRobot =
|
||||
class ConwayRobot
|
||||
connection:
|
||||
name: 'Sphero', adaptor: 'sphero'
|
||||
|
||||
|
@ -65,7 +65,7 @@ ConwayRobot =
|
|||
|
||||
|
||||
for bot in bots
|
||||
robot = Object.create(ConwayRobot)
|
||||
robot = new ConwayRobot
|
||||
robot.connection.port = bot.port
|
||||
robot.name = bot.name
|
||||
Cylon.robot robot
|
||||
|
|
Loading…
Reference in New Issue