everything worked fine before i added in ‘setInterval’ to make it loop, after i included ‘setInterval’ the console said that i needed to define ‘isKeyDown’, how do i fix this?
var upspeed = 0
var downspeed = 0
var rightspeed = 0
var leftspeed = 0
function checkkeys() {
if (isKeyDown(“s”)) {
upspeed += 1.5
}
if (isKeyDown(“w”)) {
downspeed += 1.5
}
if (isKeyDown(“d”)) {
rightspeed += 1.5
}
if (isKeyDown(“a”)) {
leftspeed += 1.5
}
}
setInterval(checkkeys,500)
this.y += upspeed
this.y -= downspeed
this.x += rightspeed
this.x -= leftspeed