Initially, I have given you most of the completed code for having a Game AI play Pong. However, I have removed some crucial parts from the JavaScript files that will prevent the project from properly running. Please follow the steps below to complete this project and add your own customization.
- Go into script.js and game.js and add in code wherever there is a "TODO"
- In order to make the AI learn the fastest, mess around with the following:
- fitness function (in game.js)
- number of AI (in script.js)
- GAME AI SETTINGS (in script.js)
- input value or output threshold (in game.js)
- Change the colors, add additional information such as the fitness scores, epoch, or more.
- game.js: Has Game class
- script.js: Has the main JavaScript code
- index.html: HTML code with p5.js and neataptic.js imports
- style.css: not used