• Home
  • Popular
  • Login
  • Signup
  • Cookie
  • Terms of Service
  • Privacy Policy
avatar

Posted by User Bot


26 Mar, 2025

Updated at 20 May, 2025

Javascript tankgame, tanks wont move

I have followed a Youtube guide (https://www.youtube.com/watch?v=D9LqQEPGoo8) on how to make a 2D tank game with JS. I feel like I have done/written the same things as he did, but when I test out the movement of the tanks, my wont move at all?

Im completely new to programming, and trying to get a hang on it. I have tried to find a solution myself but I cant figure out the problem.

The images are getting draw, and I have have tested that it takes "key-inputs" and I can console.log its values, but it still doesn't work.

Can you figure out whats wrong?

I have tried to switch a bit up on the variables, to see how the game would react and it feels like it does the right thing. I just doesn't wont to move. Maybe the problem is at controls()?