Use class-based syntax

This commit is contained in:
deadprogram 2013-11-07 06:55:27 -08:00
parent fb9dd50242
commit ab3c038dd1
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ bots = [
{ port: '/dev/rfcomm1', name: 'Louise' }
]
SpheroRobot =
class SpheroRobot
connection:
name: 'Sphero', adaptor: 'sphero'
@ -19,7 +19,7 @@ SpheroRobot =
me.sphero.roll 60, Math.floor(Math.random() * 360)
for bot in bots
robot = Object.create(SpheroRobot)
robot = new SpheroRobot
robot.connection.port = bot.port
robot.name = bot.name
Cylon.robot robot