Sep 16, 2024
Game Code Comparison: ChatGPT o1 vs ChatGPT 4o
I wanted to see how the two models stack up when it comes to writing game code, so I gave them the same prompt and compared the results.
Source code
You can find the full source code on GitHub: Source code
Prompt for the game
Here's what I asked both models to build:
- A simple pacman-like game using HTML, CSS, and JavaScript
- White background for the game board
- Bricks that block the player's movement
- A dog character controlled by arrow keys, using "dog.webp" as the image
- Basic walls and apples to collect, using "apple.webp" for the apples
- Images sized correctly
- Simple keyboard controls
- Apples appear randomly at the start and occasionally during gameplay
- The dog keeps moving forward and stops when it hits a wall
- Apples disappear when the dog touches them
- Smooth movement animation
- Smooth apple disappearance animation
Prompt for the dog
I also asked both models to create a 3D soft style cartoon image of a dog with a white background.
Prompt for the apple
And I asked them to create a 3D soft style cartoon image of an apple with a white background.