Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- init: function(elevators, floors) {
- for (i = 0; i < elevators.length; i++) {
- elevators[i].on("idle", function(){
- elevators[i].goToFloor(0);
- });
- elevators[i].on("floor_button_pressed", function(floorNum) {
- elevators[i].goToFloor(floorNum,true);
- });
- }
- /*var elevator = elevators[0]; // Let's use the first elevator
- elevator.on("idle", function() {
- // The elevator is idle, so let's go to all the floors (or did we forget one?)
- elevator.goToFloor(0);
- elevator.goToFloor(1);
- });*/
- },
- update: function(dt, elevators, floors) {
- // We normally don't need to do anything here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement