Making games is hard and require lots of coding and testing.
Use generative AI like ChatGPT to write all or most of the code. For more complex games, use ChatGPT to create an outline and game template. You will have to create the graphics but you can use generative AI like DALL-E for assistance. You also need more code to fill in the details, but you can prompt ChatGPT to write the code for you.
Start with simple ChatGPT prompts, then progressively add more features. Prompts such as the following were entered in order to create a game like the one in this repo.
python simple dungeon crawler with monsters and exit
python dungeon crawler monster with simple pathfinding
python role playing battle system
python role playing battle system with random monsters
python role playing battle system with skills
python role playing battle system with skills and difficulties
- Install Python 3.
- In command line, enter "python game.py".
- Play the game.
C:\projects\chatgpt-python-game>python game.py
P....
....E
.....
.....
....M
Move (n/s/e/w): s
.....
P...E
.....
...M.
.....
Move (n/s/e/w): e
.....
.P..E
..M..
.....
.....
Move (n/s/e/w): e
You have encountered a Orc
Player HP: 100
Orc HP: 80
Choose an action (attack/skill/run): skill
Available skills:
slash ( 15 damage, difficulty 0.8 )
stab ( 10 damage, difficulty 0.9 )
double attack ( 20 damage, difficulty 0.6 )
Choose a skill: double attack
Player used double attack and dealt 15 damage to Orc
Monster dealt 7 damage to player.
Player HP: 93
Orc HP: 65
Choose an action (attack/skill/run): skill
Available skills:
slash ( 15 damage, difficulty 0.8 )
stab ( 10 damage, difficulty 0.9 )
double attack ( 20 damage, difficulty 0.6 )
Choose a skill: slash
Player used slash and dealt 10 damage to Orc
Monster dealt 7 damage to player.
Player HP: 86
Orc HP: 55
Choose an action (attack/skill/run): skill
Available skills:
slash ( 15 damage, difficulty 0.8 )
stab ( 10 damage, difficulty 0.9 )
double attack ( 20 damage, difficulty 0.6 )
Choose a skill: stab
Player used stab and dealt 5 damage to Orc
Monster dealt 7 damage to player.
Player HP: 79
Orc HP: 50
Choose an action (attack/skill/run): skill
Available skills:
slash ( 15 damage, difficulty 0.8 )
stab ( 10 damage, difficulty 0.9 )
double attack ( 20 damage, difficulty 0.6 )
Choose a skill: slash
Player failed to use slash
Monster dealt 7 damage to player.
Player HP: 72
Orc HP: 50
Choose an action (attack/skill/run): skill
Available skills:
slash ( 15 damage, difficulty 0.8 )
stab ( 10 damage, difficulty 0.9 )
double attack ( 20 damage, difficulty 0.6 )
Choose a skill: stab
Player used stab and dealt 5 damage to Orc
Monster dealt 7 damage to player.
Player HP: 65
Orc HP: 45
Choose an action (attack/skill/run): skill
Available skills:
slash ( 15 damage, difficulty 0.8 )
stab ( 10 damage, difficulty 0.9 )
double attack ( 20 damage, difficulty 0.6 )
Choose a skill: double attack
Player used double attack and dealt 15 damage to Orc
Monster dealt 7 damage to player.
Player HP: 58
Orc HP: 30
Choose an action (attack/skill/run): skill
Available skills:
slash ( 15 damage, difficulty 0.8 )
stab ( 10 damage, difficulty 0.9 )
double attack ( 20 damage, difficulty 0.6 )
Choose a skill: slash
Player used slash and dealt 10 damage to Orc
Monster dealt 7 damage to player.
Player HP: 51
Orc HP: 20
Choose an action (attack/skill/run): skill
Available skills:
slash ( 15 damage, difficulty 0.8 )
stab ( 10 damage, difficulty 0.9 )
double attack ( 20 damage, difficulty 0.6 )
Choose a skill: slash
Player used slash and dealt 10 damage to Orc
Monster dealt 7 damage to player.
Player HP: 44
Orc HP: 10
Choose an action (attack/skill/run): skill
Available skills:
slash ( 15 damage, difficulty 0.8 )
stab ( 10 damage, difficulty 0.9 )
double attack ( 20 damage, difficulty 0.6 )
Choose a skill: slash
Player failed to use slash
Monster dealt 7 damage to player.
Player HP: 37
Orc HP: 10
Choose an action (attack/skill/run): skill
Available skills:
slash ( 15 damage, difficulty 0.8 )
stab ( 10 damage, difficulty 0.9 )
double attack ( 20 damage, difficulty 0.6 )
Choose a skill: stab
Player used stab and dealt 5 damage to Orc
Monster dealt 7 damage to player.
Player HP: 30
Orc HP: 5
Choose an action (attack/skill/run): skill
Available skills:
slash ( 15 damage, difficulty 0.8 )
stab ( 10 damage, difficulty 0.9 )
double attack ( 20 damage, difficulty 0.6 )
Choose a skill: stab
Player used stab and dealt 5 damage to Orc
Monster dealt 7 damage to player.
Monster was defeated.
.....
..P.E
.....
.....
..M..
Move (n/s/e/w): e
.....
...PE
.....
...M.
.....
Move (n/s/e/w): e
You win!
This project is licensed under the Apache 2 License - see the LICENSE file for details