Advertisement
Guest User

Untitled

a guest
Feb 16th, 2020
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.     init: function(elevators, floors) {
  3.         var elevator = elevators[0]; // Let's use the first elevator
  4.  
  5.         // Whenever the elevator is idle (has no more queued destinations) ...
  6.         elevator.on("idle", function() {
  7.             // let's go to all the floors (or did we forget one?)
  8.             elevator.goToFloor(0);
  9.             elevator.goToFloor(1);
  10.         });
  11.        
  12.         myFunction(floors);
  13.     },
  14.  
  15.     update: function(dt, elevators, floors) {
  16.         // We normally don't need to do anything here
  17.     },
  18.            
  19.     myFunction: function(floors) {
  20.        
  21.     };
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement