From d485486b00cee031327cacf1fabf05f9c5caa3ec Mon Sep 17 00:00:00 2001 From: "NB-PBG2H23ABR\\bib" Date: Tue, 27 Aug 2024 10:13:36 +0200 Subject: [PATCH] =?UTF-8?q?Spieler=20l=C3=A4uft=20immer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/allg.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/js/allg.js b/js/allg.js index 57760f8..6ee2230 100644 --- a/js/allg.js +++ b/js/allg.js @@ -12,6 +12,7 @@ let aIsPressed = false; let runAnimation; fillArrays(); +startAnimation(); //currentPosition = window.getComputedStyle(player).left; // Pictures @@ -48,10 +49,6 @@ function playerRunAnim() //------------------------------------------------------------- checkInput ------------------------------------------------------------------ document.addEventListener('keydown', function(event) { - if(!aIsPressed && !dIsPressed) - { - startAnimation(); - } if(event.key == "d") { if(runDirection != 1) @@ -86,7 +83,6 @@ document.addEventListener('keyup', function(event) if(!aIsPressed && !dIsPressed) { runDirection = 0; - clearInterval(runAnimation); } });