Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
jQuery Keydown Movement
I am trying to make the plane img go across the screen. I have attached my code below. What am I doing wrong? Do I need to incorporate a specific script plug-in?
Tom Mertz15,254 Points
I just loaded up your codepen and I was able to get the image icon to move across the screen and go up, down, and back with wasd. Was that what you were trying to do?
James Barnett39,199 Points
Your JQuery works fine, I'm not sure what you are seeing. I forked your pen, added in plane & background image instead of the local images that codepen was 404'ing on. I also changed the delay on
'fast' is is 200ms down to
1 to reduce the lag.