Pong^2

So yeah it’s Pong, but the ball splits every time it hits a Paddle. I made it with libGDX. This is my first post here, and my first game worth releasing. I wish it was a bit cooler than this, but meh.

http://thisissilly.x10.mx/pong.php

This is really cool! :slight_smile:

The only problem I noticed was the AI for the enemy. It… doesn’t seem very intuitive. Am I wrong or does it just track the balls position and move directly proportional to the ball closest to it?

-Nathan

Yeah it’s really dumb. It follows what is supposed to be the oldest ball. What would you suggest the AI do in a situation like this? Even human intelligence panics when confronted with the situation.

No idea :x I have never done any sort of AI programming, other than this basic pac-man game --> http://natekramber.co.cc/ (click the pac-man link on top)

I’m guessing you should try to predict where the ball is going to go based off of its direction and velocity, and move accordingly, instead of moving pixel-for-pixel with it.

-Nathan

Well that’s not the problem. It’s all the other balls coming in right after it.

Could you work out where each ball will pass the line and then move the paddle to the place that meets the most of the ball. Obviously time comes into play ie when will the balls pass the line and can the paddle get to position in time.

Okay, updated it. Now it has pausing, smoother controls, and a harder AI that gets the ball that will arrive first. I have yet to beat it. Can you?

Holy shit, that AI is crazy! Nice job!

How to do the AI:
Well when I think about this kind of stuff I imagine what the player has to do. Generally the player will attempt to hit the ball closest to their goal. Correct?
So we get the ball that is closest in x-terms to the AI’s paddle, and navigate the paddle to that ball.

Yeah, I guess that could be a thing for a medium difficulty, instead of factoring speed as well.