View difference between Paste ID: JMmEws7t and GbAJkvqb
SHOW: | | - or go back to the newest paste.
1
var Control = (function () {
2-
    function Control() {
2+
    function Control() {}
3-
        this.c = 0;
3+
4-
    }
4+
5
            case 39:
6
                Control.moveLeft = false;
7
                break;
8
            case 38:
9
                Control.moveForward = false;
10
                break;
11
            case 37:
12
                Control.moveRight = false;
13
                break;
14
            case 40:
15
                Control.moveBackward = false;
16
                break;
17
        }
18
    };
19
20
    Control.prototype.keyDown = function (key) {
21
        switch (key) {
22
            case 39:
23
                Control.moveLeft = true;
24
                break;
25
            case 38:
26
                Control.moveForward = true;
27
                break;
28
            case 37:
29
                Control.moveRight = true;
30
                break;
31
            case 40:
32
                Control.moveBackward = true;
33
                break;
34
        }
35
    };
36
    Control.moveForward = false;
37
    Control.moveBackward = false;
38
    Control.moveLeft = false;
39
    Control.moveRight = false;
40
    return Control;
41
})();