By Andy Gong
University of Toronto 2022 ESC180 Pong Contest Champion :>
How the bot works:
Potential improvements:
Link to pong demo: https://www.youtube.com/watch?v=FITEjcnJWJ8
You will need to install pygame
If you don’t have it installed, run pip install pygame
in terminal or run pip install -r requirements.txt
PongAIvAI.py
is the game engine that calls pong_ai function from the AI (or takes in keyboard input).
paddles[0].move_getter
or paddles[1].move_getter
on line 390 and 391 to the function of your choice that returns “up” or “down” given the same input to pong_ai.clock_rate
on line 372.score_to_win
on line 374.1
with 0
on line 393 and 402.pong_ai.py
includes function pong_ai()
which is my pong AI. Other functions in the file are helper functions for pong_ai()
.chaser_ai.py
includes its own pong_ai()
which is the starter AI that only move up or down based on the ball’s current location.requirements.txt
includes the packages required to run the game. In this case, it’s only pygame
.