• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Movement problem using wasd

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a little game where I can move around a tile map using the arrow keys and the WASD keys. Problem is that when I bump in the left wall using the ASDW keys (so with the A key) and try to go up at the same time, the inputs stop working for a while. How do I solve this?
My code:

Game class


Screen class


Keyboard class


Also I have two other problems I have yet to solve: The requestFocus in the window does not work (on mac) and when I move, some of the tiles have a different colour at the edge.
 
Luc Drenth
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*Edit: When I outputted the value of the up / left / right / down to the console, it shows false when the bug occurs. I'm thinking the problem should be in the Keyboard class but I can not find any flaws in it.
 
Luc Drenth
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
btw I accidentally clicked resolved but it is not resolved .. sorry, I'm new here.
 
Sheriff
Posts: 24594
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem, I marked it as unresolved.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!