AirPong4k

My first entry on a contest and one of the few games that i have “finished” ;D

AirPong4k is an implementation of a clasic game that can be found in any gaming centre.


http://flx.proyectoanonimo.com/proyectos/webstart/airpong4k/apshot.jpg

Tested on linux, mac and win. Sound is only supported in some devices.

Controls:
*Use the mouse to control your pad, spacebar to restart and escape to exit.

Objective:
*Send the disc to the oposite goal to score a point. Score 7 points to win a match, it’s that simple ::slight_smile:

It’s not over-optimized nor obfuscated and it’s compressed with the usual jar tool, however, it’s still below 4096b (3919b 3901b 3973b) so if it doesn’t break any rule, i’ll accept any sugestion to improve the game :slight_smile:

Play the game

[edit] fixed the mouse lag, but i have to review the collision detection to be more accurate updated. size 3901b ;D[/edit]
[edit²] changed some colors and limited puck speed. Screenshot and size also updated [/edit]

Nice, but you need a decent mouse with a decent refresh rate, or, like me, you end up scoring on yourself a lot :slight_smile:

The paddle shouldn’t lag behind the movement of the mouse. You should match it. It is far to hard to make a proper shot with it the way it is. Otherwise, it is well done. Nice that is has sound to.

Nice game! However, I have to agree, the mouse lag is somewhat disturbing.

wow! nice implementation of air hockey, but as with everyone else… that paddle has to synch with the mouse

I’m working on that now.

Originaly, the paddle moved within the processMouseMotionEvent method, but that leaded to unexactly collision detection and you could pass over the disc without hitting it or hitting it on undetermined locations (even hit it back) so i sinchronized the paddle movement to the main cicle, registering only the velocity of the movement in the processevent and aplying int on the main cicle, what seems to be a litle odd…

Now i have switched back to move with the processMouseMotionEvent method, and trying to predict the collision iterating over the points of a striaght line betwen the position of the paddle now and in the previous cicle, but it seems to be innacurate too (maybe it’s my code).

Any idea?

Agree about the mouse lag, afraid I can’t be of much help though. On the graphics: That purple doesn’t work with that grey for me :smiley: I’d trade the purple for another color, but that’s probably just me. Great work!

Amazing work! :o

thanks for the feedback ;D

i forgot to upload the fixed version before answering ::slight_smile:

the mouse lag has almost desapeared now but i’d like you to try if the collision detection is accurate enough.

Nice game, there was only a little lag nd the ai seems wuite good too. :slight_smile:

that’s really cool, great game idea and implemented well. the extra spark effects are a nice touch :wink:

the only issue I have with it now is that I think the puck is a little too sensitive to the mouse. 3 or 4 times the puck was at a really high velocity to the point where it was almost blinking randomly around the table… I would suggest adding maybe a maximum impact velocity…

Hahaha I love the music at the end! It almost jolted me out of my chair.

New version uploaded ;D

traded the magenta line and goal for a dark green ones :wink:
puck speed has been limited, still fast, but at least it won’t craze up

[quote]Hahaha I love the music at the end! It almost jolted me out of my chair.
[/quote]
i was specting someone to notice this ;D

music is randomly generated with something like midiChanel.noteOn(random.nextInt(128), random.nextInt(128)) i found that drama-thilling-ish sound hilarious and kept it in the game, but i’m thinking in something a litle more “elaborate” for a upcoming version :lol:

Sound didn’t work for me :S
Great improvements, good work.

This game is brilliant, i used 2 play air hockey at school all the time, so i kinda like air hockey games
but this game really has style also very addictive

thanks, really ;D i have just arrived from an exam an i needed that

have just fixed a bug on closing when /dev/sequencer was busy (on linux)

I didn’t get any lag between my mouse and paddle movement, however it did seem that your calculations are a little rugged as I could still move the mouse fast enough so that it was past the puck, and then all of a sudden the puck flew backward. This happened way too many times. Apparantly I can’t hit it too fast :slight_smile: Also, I saw times where if you dragged the puck, all of a sudden the puck would accelerate like crazy. I’d imagine if you use proper momentum equations this shouldn’t happen. This was also seen when the puck would accelerate out of control, I’d put the paddle in its path, hold it still, and the puck would come almost to a dead stop. I agree it should slow down, but not as much as it does.

I traded that for the paddle lag, using some predictive collision detection didn’t seems to work, i’ll have to look into that and try to do proper collision detection within 4k ::slight_smile:

[quote=“Malohkan,post:17,topic:25491”]
I thought i had that fixed by limiting the puck speed, i’ll try to reproduce that and see if i can fix

Now the links point to woogley’s official j4k games list :slight_smile:

Nice game.

Although, as everyone point out, the paddle is sluggish. Also, I did not hear any sound.