Log In  

Cart #chatgpt_chase-1 | 2022-12-15 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

My second ChatGPT game.
I will note any changes I made to its code but otherwise, all code and comments were created by ChatGPT with prompts in order listed.

Prompts:

  • Pico-8 basic game code
  • Add player using pset, with movement control
  • Add enemy at random spot at the edge of the screen, enemy should attack player within 30 pixels
  • Player shoots at enemy using pset
  • Enemy moves toward middle of screen
  • What should I add to my game?
    • It told me to add player and enemy health text display and something to happen when player or enemy dies
  • Add health display
  • How can I improve this code?

    • It said:

      • Add more enemy types, each with their own behavior and appearance. For example, you could add a faster enemy that moves towards the player even if they are not close, or a stronger enemy that takes more hits to defeat.

      • Add obstacles and power-ups that the player can interact with. For example, you could add walls that the player can hide behind, or health packs that restore the player's health.

      • Add a scoring system that rewards the player for defeating enemies and completing objectives. You could also add a high score table to keep track of the best players.

      • Add a level system with progressively harder challenges. For example, you could add more enemies, stronger enemies, or tougher objectives as the player progresses through the game.

      • Add sound effects and music to enhance the gameplay experience. For example, you could add a background music track, and sound effects for player movements, enemy attacks, and projectile impacts.

Changes:

Line 34, Added cls()
Lines 36-39, fixed button assignment. was 0123 now 2301
Lines 54 and 55, swapped sin and cos
Lines 67 and 78, replaced chatgpt's comments for "something to happen" with _init()
Lines 88 and 89, swapped sin and cos
Lines 95 and 96, swapped sin and cos
Line 115, text position was (64,0) now (0, 10)

P#122449 2022-12-15 03:43 ( Edited 2022-12-15 04:02)

It's a little simple, @kvittore.

Pattern. Move away from the enemy so he is right behind you. Hold down the firing button. Complete.

Perhaps add an enemy for every level. So after the first level you have 2 targets after you, each coming from different directions. Level 3, 3, and so on.

P#122454 2022-12-15 04:34 ( Edited 2022-12-15 04:37)

Yeah, it wasn't about making a super great game. It was to test making a game entirely via the ChatGPT AI.
From natural language prompts, in about 30 minutes, it wrote very nearly bug-free code, with useful and accurate comments, and made suggestions for features and improvements.
It made a game better than I think a human with no code/game making experience could after hours of learning and testing.

P#122475 2022-12-15 15:50

It is (of course) barebone but this very implementation can lead to funny gameplay ideas. Like the fact that it's really hard to hit the enemy with a projectile unless you stay close enough.

I'm still amazed that the output code actually works with so few tweaks!

P#122574 2022-12-17 00:11

[Please log in to post a comment]