Sure! Here's an example of a simple ping-pong game implemented in a single HTML file using JavaScript:
In this game, you control the paddle by touching and dragging on the canvas. The black rectangle on the right side represents your paddle, and the black rectangle on the left side represents the AI paddle. The game starts with a ball in the middle, and you need to prevent it from hitting the right wall. The AI paddle moves randomly, providing basic AI functionality.
Note: This is a basic implementation just to demonstrate the concept. You can enhance the game further by adding scoring, levels, and more complex AI logic if required.