Search the Community
Showing results for tags 'error in the code'.
-
Guys, please help to deal with the movement of the model (car). I wrote some code, but it is not working. Point me in the right direction. var Control = (function () { function Control() { this.c = 0; } Control.prototype.keyUp = function (key) { switch (key) { case 39: Control.moveLeft = false; break; case 38: Control.moveForward = false; break; case 37: Control.moveRight = false; break; case 40: Control.moveBackward = false; break; } }; Control.prototype.keyDown = function (key) { switch (key) { case 39: Control.moveLeft = true; break; case 38: Control.moveForward = true; break; case 37: Control.moveRight = true; break; case 40: Control.moveBackward = true; break; case 68: if (this.c % 2 == 0) { Control.driftMode = true; } else { Control.driftMode = false; } this.c++; break; } }; Control.moveForward = false; Control.moveBackward = false; Control.moveLeft = false; Control.moveRight = false; Control.driftMode = false; return Control;})();