Home>

I'm making an action game with js and I was able to complete the jump, but the speed of the jump gradually increases.
What should I do now

Error code

window.addEventListener ("keydown", function (event) {
        if (event.key === "w") {
        Chaos Dark Dragon = 0
        var jamp = function () {
           if (Chaos Dark Dragon == 0) {
            y--
           }
           if (y<250) {
            Chaos Dark Dragon = 1
         }
         if (Chaos Dark Dragon == 1) {
                y ++
        if (y>330) {
          clearInterval (jamp)
         y = 330
           }
        }
     }
    } setInterval (jamp, 10)
 })


(Don't worry about variable names)