I have the following code in a single file, but it does not seem to work.
I basically try to create an object and try to just call the function of the object and display it, it does not, and I do not know why.
var mice = new Mice(10, 10); function Mice(posX, posY) { this.x = posX; this.y = posY; this.moveLeft = function () { this.x = x - 1; } this.moveRight = function () { this.x = x + 1; } this.getXPos = function () { return this.x; } } document.onkeydown = function(e) {
Any help trying to get this job would be greatly appreciated.
thanks
Danny source share