I came across 'delays' in my early game efforts which seemed to be related to how key repeats are handled. The way to demonstrate the effect is to open a text editor and hold down a letter key. After the first letter is displayed there is a noticeable delay after which the letter then repeats quickly (in Windows at least). I would get the same responses in my game.

My way round it is rather than respond to action directly in the overridden keylistener methods, I use them to set booleans which eliminate the 'lag' as the game movement logic now relies on the boolean values rather than the raw keypress data.

I'm not sure if this is the same problem you are experiencing, but from what you are describing it sounds very familiar to my experiences.

Well I presume it's the act of closing down the applet, as in closing the window. It's only an (un?)educated guess as everything is fine when it's running!

I'm just checking if there is anything else I should be doing. Below is my game loop code, which is pretty similar to tutorials and other posts on this board. I've never seen any examples of putting the drawing code in a try block and was wondering if there was a reason for it and if the IllegalStateException is common when exiting. The exception might not even be an issue since I'm closing it down anyway, but I've only been playing with BufferStrategy for the last week so I'm very green!

I've moved over to use BufferStrategy from BufferedImage for my first attempt at a game (I'm using Java2D as a learning experience) and the performance boost is pretty noticeable. I'm constructing the game as an applet for the time being and it's all working fine, but when running it from Netbeans/AppletViewer I get an ugly IllegalStateException showing up in the console when I close down the applet. Presumably that's because I'm killing it mid-flow.

Is there any particular way I should be handling this? I could of course put the BufferStrategy code in a try block and handle the exception that way, but I just wanted to check if that was the right thing to do and/or if there is a better way of doing it?

I've been learning Java for the past year or so and game programming about the last 3 months. From my experience it's not knowing what questions you need to ask to get to where you want to be.

6 months ago I was dealing with which layout to use in a Swing application. If back then I thought 6 months later I would be able to understand what a BufferStrategy is let alone what it is for and how to use it I would have laughed!

Online tutorials only went so far for me and in the end I bought a Java game programming book which takes you through a project start to finish. It doesn't teach you everything but gives an understanding to move forward with.

It's very daunting at first, but once you get to a certain point the knowledge will start to snowball. That's my 2c as a newbie myself!

I've been programming in Java for a little while now (as an amateur) and i'm now making a foray into writing some 2D games. My first prototype is coming along nicely, but I have a couple of questions about server side.

I've read some topics on here that confirm PHP can be used as a viable server side in certain circumstances. To begin with I want to keep things fairly simple and for my first prototype I just want to keep high scores server side so they are accessible to anyone who plays the game. I have some experience of PHP so it would be good to 'go with what you know' to get used to things.

Later on I want to explore things where state is saved when placing objects, similar to games with mechanics like FarmVille where you place objects and then come back later.

I've been trying to google about the best way to go about this, but finding out the nuts and bolts of the way to go about this on google seems to not be that easy.

My own thought would be to bundle up the data into XML and then buffer stream it to the PHP script to parse and store in MySQL and vice versa back to the client. Would this be a viable way to do it or am I missing a trick here? (most likely!)

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org