-
Notifications
You must be signed in to change notification settings - Fork 0
/
elevator5.js
41 lines (36 loc) · 1.11 KB
/
elevator5.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
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];
elevator2.on("idle", function() {
elevator4.goToFloor(0);
});
elevator4.on("floor_button_pressed", function(floorNum){
elevator4.goToFloor(floorNum);
});
var floor1 = floors[1];
floor1.on(
},
update: function(dt, elevators, floors) {
}
}