This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createAttributeMonitor = -> | |
monitored = Object.create null | |
(parentModel, name) -> | |
bubbleEvent = (event, args...) -> | |
return unless event.startsWith 'change:' | |
parentModel.trigger "change:#{name}.#{event[7..]}", args... | |
value = parentModel.get name | |
oldValue = monitored[name] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); |
NewerOlder