Merge pull request #12 from hybridgroup/12-upd-collision-example
Updated collision example to perform better and start running when you d...
This commit is contained in:
commit
4268a25ad7
|
@ -15,6 +15,7 @@ Cylon.robot
|
|||
Logger.info('Setting up Collision Detection...')
|
||||
me.sphero.detectCollisions()
|
||||
me.sphero.setRGB(color)
|
||||
me.sphero.stop()
|
||||
)
|
||||
|
||||
me.sphero.on 'collision', (data) ->
|
||||
|
@ -22,8 +23,6 @@ Cylon.robot
|
|||
color = color ^ bitFilter
|
||||
console.log("color: #{ color.toString(16) } ")
|
||||
me.sphero.setRGB(color)
|
||||
|
||||
every 1.second, ->
|
||||
me.sphero.roll 90, Math.floor(Math.random() * 360)
|
||||
|
||||
.start()
|
||||
|
|
Loading…
Reference in New Issue