Q*Bert4K

A simple Qbert clone.
Use the Arrow keys to move.

http://j4k.freehostia.com/qbert.jnlp

Really cool! Loving this.

All I get is a grey Window. :’(

XP with Version 6 update 11.

The key detection is horrible for me. It misses lots of key presses, and then moves twice when I only pressed the key briefly once.

I replaced the jar with a version that uses nanoTime instead of currentTimeMillis. So hopefully this will maintain a better frame and key checking rate. Was it running slowly on your machine.
I am just overiding the processKeyEvent() method to store the key press and then checking for the key in the game loop. So if you are missing events the only thing i can think of is that the game loop is running too slow. If it is still a problem I will look and decoupling the logic loop from the draw loop.

Not sure what the issue with the gray screen is, any exception. I also now get and dispose of the graphics context each frame so this may fix the gray screen issue. Refresh and let me know if it helps.

wow. really cool remake of this classic! great job! I tried to work on a similar game for last year competition but I was not able to get it in 4k. Are you planning to release the source code?

No, there wasn’t anything in the console, but it works now. :slight_smile: Nice.

The key presses don’t feel quite right. If you hold a key down, there is a longer delay after the first jump than after the following ones, like the standard key repeat you get while typing. I’d guess your key events are coming in like that.

The double-movement appears to be fixed but it’s still missing 70% of key presses.

Edit: why would the speed of the game loop matter? Mark the key as down in the event thread when you get a KEY_PRESSED event and mark it as up in the logic thread when you process it. You can still miss some keys presses, but speed is irrelevant because it’s just a synchronisation issue. If you have the spare bytes, see my thread on key handling. No-one’s made any comments on it yet, but at least that means that if it has any flaws they’re not glaringly obvious.

A litle bug if you die when completing the last square, you don’t pass to the next stage, and cannot win (all squares painted)

I found the problem. I had a while loop to maintain the frame rate but on slow systems there was never any free time left over so the while loop was never entered. The result was yield was never called so the event thread was starved hence the key press was missed. I changed to a do while so yield will be called on every render loop.

I saw the bug on the die on the last square too. I will look into it as soon as I can until then don’t die on the last sqaure :).

Just updated the game. Fixed the death on last square and added a bunch of new levels. Let me know if there are any issues. Also added faster balls and a green gremlin that turns the squares back to the original color. Also squares that must be hit twice. The format of a level is as follows:




                       "      p      "+
                       "     * *     "+
                       "    * * *    "+
                       " l * * * * r "+
                       "  * + + * *  "+
                       " * * * * * * "+
                       "- - - - - - -",


a 13X7 grid
Where
p = player start square

  • = normal square
  • = snake spawn point
    l,r = left and right flying disk
  • = double hit square
    space = empty square

If any one wants to send me an interesting level I still have room to include it.