From 1ee1c989544975325e27dc3fdb7cd43077b9143c Mon Sep 17 00:00:00 2001 From: "NB-PBG2H23ABR\\bib" Date: Mon, 26 Aug 2024 15:13:13 +0200 Subject: [PATCH] animation variable gemacht --- js/allg.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/allg.js b/js/allg.js index a6427d6..57760f8 100644 --- a/js/allg.js +++ b/js/allg.js @@ -3,7 +3,8 @@ let tomAnim = []; let enemyAnim = []; let playerAnimState = 0; let runDirection = 0; -let runSpeed = 5; +let runSpeed = 25; +let animationSpeed = 50; let currentPosition = 0; let player = document.querySelector("#fuchs img"); let dIsPressed = false; @@ -32,7 +33,7 @@ function gameLoop() //-------------------------------------------------------------- Animation ----------------------------------------------------------------------- function startAnimation() { - runAnimation = setInterval(playerRunAnim, 100); + runAnimation = setInterval(playerRunAnim, animationSpeed); } function playerRunAnim()