I seem to have done something wrong and cant find any solutions. I've tried to convert them into numbers and tried += but i get NaN.
function circle() {
this.x = 60;
this.y = 200;
this.draw = function() {
ellipse(this.x, this.y, 20, "green");
};
this.move = function() {
$(document).keydown(function(e) {
// console.log(e.keyCode);
if (e.keyCode === 68) {
this.y += 1;
console.log(this.y);
}
});
};
}
Might it be because they are not variables?
thanks :)