This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
This is my first post on this forum, and definably not my last. I intend to stick with this one for all my code related questions. I'm still starting out, and I have had no coding advice so far, so please don't judge my organization.
Now, I have been trying to make a 2D side scroller strategy game. I currently have completed a decent amount of the project - file format, reader, and the display for showing the blocks that works very nicely. I'm using the Graphics object to paint on a JPanel component on a JFrame for the game. I believe this is not nearly as efficient or capable as other ways to display graphics, but being a premature programmer, I don't know any other way.
I'm using the KeyListener for character movement. This works fine, except that there is a delay before the listener starts repeating the contained code while the key is held down. I don't mind using a different way of listening to key actions, but, again with my inferior programming skills, I do not know any other to do this. How would I solve this issue?
Here's the listener code I've written:
this code exists in the constructor method of an inner class that extends JPanel.