Blasted Crates

A simple, addictive and sometimes difficult one-button game requiring ninja-like skill and reflexes. More levels coming soon.
Made with LibGDX.

http://gamepyong.com/blasted_crates/index.php

Some videos:
Level 8.2


Level 8.3

Update 1:
[i]- Added 3 new levels

  • Capped the delta time to prevent cheating
  • Added a few new types of crates
  • You will now be able to continue from the round you reached
  • Rewrote the storyline to be somewhat like a Bastion-esque narration (at least it sounds like the Bastion narrator in my head when I’m reading it ;))[/i]

I like the game, but for a game that requires lightning reflexes, the variable input lag is somewhat killing it. Sometimes when I hit the spacebar, I immediately jump, while on other occasions it waits for like ‘10px’ (whatever that is in millis), meaning that I cannot physically make the next jump. Sometimes the input lag is so bad that I start jumping after respawning :frowning:

I couldn’t beat the damned stage 3!

I didn’t experience the lag Riven said.
However, when I first clicked on HighScores, I got a NPE:


Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Error reading audio data.
	at com.badlogic.gdx.backends.openal.Mp3$Music.read(Mp3.java:90)
	at com.badlogic.gdx.backends.openal.OpenALMusic.fill(OpenALMusic.java:170)
	at com.badlogic.gdx.backends.openal.OpenALMusic.update(OpenALMusic.java:157)
	at com.badlogic.gdx.backends.openal.OpenALAudio.update(OpenALAudio.java:218)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:203)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:135)
Caused by: java.lang.NullPointerException
	at com.badlogic.gdx.backends.openal.Mp3$Music.read(Mp3.java:81)
	... 5 more

looking good so far!

Thanks for playing guys. About the lag, I’m not entirely sure how to resolve that because in LibGDX you can handle input either via their Polling mechanism or using Event Handling. Crates uses event handling because the LibGDX wiki says polling might produce missed events. http://code.google.com/p/libgdx/wiki/InputPolling

I’m in level 7 with ~400 deaths. It’s really a challenging game, but annoying as ***** when you click and the guy runs straight into a tomato filled box!

It might also be a logic error. Maybe there are certain conditions that are checked before a jump is allowed, which need to be fixed.

quoting libgdx:

I don’t think you’ll miss an event, only if the guy presses and releases a key in less then 1000/fps milliseconds (I think that’s what the caution is about). If you’re running at 60FPS, I think it’s physically impossible to a human to press and release a key faster than that.

And, from my own experience (I’m writing a libgdx game right now), I’ve never experienced a key polling miss.

[quote]It might also be a logic error. Maybe there are certain conditions that are checked before a jump is allowed, which need to be fixed.
[/quote]
I believe the only condition I check is if the player is on the ground before attempting to jump. I’ll see.

[quote]And, from my own experience (I’m writing a libgdx game right now), I’ve never experienced a key polling miss.
[/quote]
Thanks, I’ll try this approach as well.

Events are best used for stuff like text input where you don’t want to miss anything, however for real time input (e.g. jumping) polling should be fine.

I’m guessing though that the reason for the delay in input is a sudden drop in frames giving a large delta time value (causing the sprite to move forward faster and hence delay the jump). One solution is to cap the delta time value to something like 20-50ms to avoid these jump delays have too much of an effect on gameplay.

btw noticed that in your appletloader html code you use the al_bgcolor and al_fgcolor parameters, these do not work with the AppletLoader anymore and you should instead use the boxbgcolor and boxfgcolor parameters. You’ll probably want the following as it’ll match your logo

<param name="boxbgcolor" value="#000000">
<param name="boxfgcolor" value="#ffffff">

Ohh I see, I’ll definitely switch to polling then. Thanks, I didn’t know those params had changed. I’ll push a new update tonight.

If you’re polling, you should jump is the key is down as well. It’s frustrating if you click just an inch too early. :emo:

Edit: I got to level six. The input lag and the problem above makes it really frustrating.

Hi

It doesn’t work. I get the following error message:
“An error has occurred while loading the applet. Please contact the support to resolve this issue. This occurred while ‘switching applet’”.

I use Firefox 14 under Mageia Linux 2, OpenJDK 1.7 update 3, Icedtea-web 1.2, ATI Radeon X1950 Pro (Gallium 0.4 driver). Minecraft demo shows me a similar message, I assume it has something to do with this bug (from Icedtea-web or LWJGL) preventing LWJGL applets from working with Icedtea-web. Xerxes uses a more recent version of Icedtea-web, he wrote that it doesn’t reproduce this problem with the provided examples on the official website of LWJGL.

@gouessej
If this was a commercial application, I wonder if looking into this would even be worth it. I mean, how big of a userbase are we losing? Why don’t you update to the same version of Iced-Tea as Xerxes?

Level9 atm. Will continue when i get home.

[quote]I’m guessing though that the reason for the delay in input is a sudden drop in frames giving a large delta time value (causing the sprite to move forward faster and hence delay the jump). One solution is to cap the delta time value to something like 20-50ms to avoid these jump delays have too much of an effect on gameplay.
[/quote]
How do I cap the delta time?

Thanks for the help and trying it out guys. I’ll post an update asap.

Unfortunately I don’t know enough about LibGDX to answer that, so hopefully some of the other members here will be able to answer that but basically the time value you use to move your sprites every frame should be capped.

Hmm, i have no input lag at all

But not being able to queue jumps makes me platinum mad :clue:

Please note that the input lag is equal for both the keyboard and the mouse.

Not sure what you mean by ‘queue jumps’. Please clarify.

If you press spacebar while still jumping, you will jump again right after landing

EDIT: Not bunnyjumping, which while spacebar is pressed, you will keep jumping