var x = 0; var y = 0; if(right.arrow == pressed){ Math.add(this.position.x + 10); } if(left.arrow == pressed){ Math.sub(this.position.x - 10); }