Last active
August 29, 2015 14:14
-
-
Save garettmd/8f28bf4fe82da94fb8fc to your computer and use it in GitHub Desktop.
Elevator Saga 2nd Challenge
This file contains 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
{ | |
init: function(elevators, floors) { | |
var elevator1 = elevators[0]; | |
elevator1.on("idle", function() { | |
elevator1.goToFloor(0); | |
}); | |
elevator1.on("floor_button_pressed", function(floorNum){ | |
elevator1.goToFloor(floorNum); | |
}); | |
var elevator2 = elevators[1]; | |
elevator2.on("idle", function() { | |
elevator2.goToFloor(0); | |
}); | |
elevator2.on("floor_button_pressed", function(floorNum){ | |
elevator2.goToFloor(floorNum); | |
}); | |
var elevator3 = elevators[2]; | |
elevator3.on("idle", function() { | |
elevator3.goToFloor(0); | |
}); | |
elevator3.on("floor_button_pressed", function(floorNum){ | |
elevator3.goToFloor(floorNum); | |
}); | |
var elevator4 = elevators[3]; | |
elevator4.on("idle", function() { | |
elevator4.goToFloor(0); | |
}); | |
elevator4.on("floor_button_pressed", function(floorNum){ | |
elevator4.goToFloor(floorNum); | |
}); | |
}, | |
update: function(dt, elevators, floors) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment