A paddle whacking retro arcade game.
Can play in-browser at itch.io: https://jeffreypersons.itch.io/paddle-whacker
Can download for Android at: https://play.google.com/store/apps/dev?id=8132485239530785081
Tired by the lack of originality found in most 'hit the ball with a paddle' genre of 2d games, Jeff wondered how it could be improved on... Taking those ideas, he came up with Paddle Whacker - a game that blends the vertical-only movement of Pong with an Air-Hockey inspired arena.
After lots of balancing and polishing the game has grown into a fully featured experience playable on both android and browser. Most noteably, features a custom-made AI using prediction based forecasting, touch support and a variety of different difficulty levels, as well as game length and sound settings.
AI behavior is now primarily driven by PaddleZoneIntersection events - triggered when a Ball intersects a PaddleZone (BoxCollider2D encapsulating each paddle, stretched from bottom to top of arena, as shown below).
The last hit zone gives us enough data to decide whether the ball is behind the AI paddle or not, and how to react to it.
- Each frame, Ai is always moving towards or present at
paddleTargetY - Upon
Ballintersecting aPaddleZone, ball entry/exit position/velocity is recorded and event is triggered, received by AI, and used to infer the state of ball relative to paddle as follows:- IF
ballIncoming(approaching ai from opponents side): PredictBallPosition (target set to projected position) - IF
ballBehind(passed ai paddle next to goal): TryToHitBallFromHorizontalEdge (target set to avoid ball or hit it on the top/bottom paddle edge, if possible, as based on the projected position) - ELSE (all other cases): TrackBall (vertically aligns the paddle with ball y position)
- IF
Basically, the ai runs in a seperate coroutine launched (after a response time delay) when its opponent (ie the player) hits the ball, and then approachs the point that the trajectory intersects with the x position of the ai's paddle.






