animation variable gemacht

This commit is contained in:
Jan Breitkreuz 2024-08-26 15:13:13 +02:00
parent a66ffaf11e
commit 1ee1c98954

View File

@ -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()