Quantcast
Channel: 2D Latest Topics
Viewing all articles
Browse latest Browse all 623

Help with controlling spritesheet with arrow keys

$
0
0

Hi, new to the forums, as well as new to coding. Started learning about a month ago.

I need help with my javascript code, I want to be able to use the arrow keys to move my character up, right, down, left, but I cannot figure out how to, I watched a video from Treehouse learning how to do this, and then I decided I would also make a separate one for myself so I copied some of the code, but It will not animate or move the sprite sheet.

The character just sits in the middle of the page even though I thought that I coded him correctly to move. He also doesn't even animate, it's completely still. 

I did however notice that when I made my background larger, that the screen would move, but I want the character to move over the screen, not move with the screen. Please help.

 

  

reddude.png

game.js

index.html


Viewing all articles
Browse latest Browse all 623

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>