Sure, I can create a simple racing game with the given requirements. Here's an example implementation in HTML with JavaScript:
This implementation sets up a simple racing game where the player (represented by a red rectangle) races against an AI (represented by a green rectangle). The player can control their position using the left and right arrow keys. The AI moves automatically towards the player. If the player collides with the AI, they lose the game. If the player reaches the top of the canvas, they win.
Please note that this is a basic implementation and can be improved further with additional features such as multiple levels, power-ups, or better graphics, as per your requirements.