In this project, you and your partner will team up to design and code your own text-based RPG adventure game! Your player will travel through different locations, meet enemies and friends, collect important items and food, battle to survive, and try to complete their journey.
You will be working together in a shared Google Colab notebook.
You can use ChatGPT to help you speed up producing the story parts (like descriptions, dialogues, and scenes), but you must write all the Python code yourselves.
Even though your game will be text-only, add some AI-generated ASCII art (like a robot, dragon, or magical sword) to bring your world to life! Creativity in the gameplay (including images) will count for 25% of the total grade of the project.
You will have four lessons to finish your project. Each lesson will have a clear goal to keep you on track.
You must include all of the following as a MINIMUM:
Print & Strings: Welcome the player and describe the adventure.
Data Types: Correct use of strings, integers, booleans.
User Input: Ask for player name, actions, and choices.
Variables: Track player health, gold, inventory, and food.
Operators: Use math to adjust health, gold, or damage.
Conditionals: Use if/elif/else to control what happens.
Loops: Use while or for loops for repeated actions (travel, battles). If your character can die in your game (especially if this might happen early on), you might want to set the entire game code inside a while True loop so the player can play again.
Functions:
At least five standalone functions (for example, travel(), battle()).
Methods inside classes do not count as standalone functions.
Lists:
Inventory list for collected items.
Food list for collected food.
Dictionaries:
Player stats dictionary (name, health, gold).
Error Handling: Use try/except to catch invalid inputs.
OOP (Classes):
Player class (mandatory).
Enemy class (mandatory).
Friend class (mandatory).
Each class must have at least two working methods.
Travelling between different locations.
Encounters with enemies (fight and lose health).
Meetings with friends (gifts, help).
Finding and collecting items (inventory list).
Finding and collecting food (food list).
Eating food to regain health.
Losing health during battles.
Ending the game when health reaches 0 (game over).
Inventory List β Store items like swords, potions, keys.
Food List β Store food like apples, bread, healing potions.
Player Dictionary β Store stats like: {"name": "Alex", "health": 100, "gold": 50}.
You must add, remove, and display information using lists and update player stats using dictionaries.
1. Post-Apocalyptic Survival
Civilisation is destroyed; scavenge for food, fight raiders, rebuild a safe base.
2. Space Exploration
Travel between planets, battle alien creatures, meet alien allies, collect technology.
3. Mythical Quest
Explore a fantasy world with dragons, magic, and powerful artifacts.
4. Cyberpunk City Adventure
Hackers, gangs, neon lights β survive in a futuristic city.
5. Pirate Treasure Hunt
Sail between islands, fight enemy ships, find treasure maps, recruit a pirate crew.
6. Haunted House Escape
Solve mysteries, defeat monsters, collect keys, and escape a haunted mansion.
7. Medieval Kingdom Survival
Survive in a war-torn kingdom β make alliances, fight bandits, find magical relics.
8. Dinosaur Island
Lost on an island full of dinosaurs β fight or tame them to survive!
Story text (descriptions, dialogues) β OK to use AI.
All coding (functions, loops, classes, structures) β NOT OK to use AI.
Share your Google Colab notebook with your partner and Mr McFarlane (Editor access).
Focus on building a fun, working, complete adventure.
Open Google Colab, the tutorial to set things up is here.
Create your personal file and your shared parent project file (follow the tutorial).
Make sure both are shared with your partner and with Mr McFarlane.
Agree on a basic story idea for your game:
Where does the hero start?
Where will they travel to?
What types of enemies and friends will they meet?
What kinds of items and food will they collect?
Write a welcome message that greets the player when they start the game.
Write a story introduction (a few sentences) to set the scene for the adventure.
Ask the player for their name using input().
Create the main starting variables:
player_name
player_health (e.g., 100)
player_gold (e.g., 50)
Create two empty lists:
inventory = []
food = []
Create a player_stats dictionary to store at least the player's name, health, and gold.
Print out the player's starting stats clearly to check that everything is working.
Create a list of possible locations (e.g., "forest", "village", "castle gate", "mountain pass").
Import the random module to help pick random locations.
Write a travel() function that:
Chooses a random location from the list.
Prints a message showing where the player has arrived.
Create random encounter events at the location:
Sometimes an enemy appears.
Sometimes a friend appears.
Sometimes the player finds an item.
Use if/elif/else inside travel() to control what happens based on the encounter:
If enemy β (prepare for battle later)
If friend β (give gift or food)
If item β (add item to inventory list)
When the player finds an item or food, use .append() to add it to the correct list.
Update the player_stats dictionary if needed (e.g., gaining gold or healing slightly).
Print out a clear encounter message each time something happens.
Use try/except to catch errors if asking for any new player input (optional at this stage).
Create your Player class:
Attributes: name, health, inventory, food
Methods:
show_stats() β print current stats
take_damage(amount) β reduce health
add_item(item) β add to inventory
add_food(food_item) β add to food list
eat_food(food_item) β heal and remove food from list
Create your Enemy class:
Attributes: name, health, damage
Methods:
attack() β return damage value
take_damage(amount) β reduce health
Create your Friend class:
Attributes: name, gift
Method:
give_gift() β return the gift (item or food)
Test your classes by creating:
One Player object using player name from earlier.
At least one Enemy object and one Friend object.
Write a battle() function:
Player and enemy take turns attacking.
Player health and enemy health must update each turn.
Use a while loop to continue the battle until one sideβs health reaches 0.
When the player wins a battle:
Print a victory message.
Optionally add a reward (gold, item, or food).
When the player loses a battle:
Print a defeat message.
End the game if health reaches 0.
Add try/except to catch errors if the player chooses invalid options during battle.
Allow the player to eat food during the game:
Show the food list.
Let the player choose an item to eat.
Heal the player by a set amount (e.g., +20 health).
Remove the food item from the list after eating.
Write a game_over() function:
Check if the playerβs health is 0 or below.
If yes, print a "Game Over" message and end the game.
Add a final travel loop (optional):
Let the player keep travelling and encountering enemies, friends, and items until they die or complete the journey
Check and clean your player_stats dictionary:
Update player stats correctly when gaining gold, health, or items.
Polish your messages and story text:
Make the journey feel complete (victory, survival, or defeat).
Make sure all print messages are clear and fit the RPG theme.
Carefully test your game:
Play it from the beginning.
Fix any crashes, bugs, or broken logic.
Submit:
Make sure your parent project file is complete.
Ensure both personal files and the parent file are shared with your partner and Mr McFarlane.
Work carefully. Organise who is doing what and which parts you will need to work on together.
Show me your working code when you believe your game is complete!