0% found this document useful (0 votes)
3 views2 pages

A Level RPG Programming Challenge

The document outlines a programming challenge to create a text-based RPG simulator where players control characters in battles. Essential tasks include defining a Character Class, implementing damage mechanics, and allowing player interaction for character attacks. Extension tasks suggest adding difficulty levels, special abilities, critical hits, and a combat history log for enhanced gameplay experience.

Uploaded by

8p4j5hc4xt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

A Level RPG Programming Challenge

The document outlines a programming challenge to create a text-based RPG simulator where players control characters in battles. Essential tasks include defining a Character Class, implementing damage mechanics, and allowing player interaction for character attacks. Extension tasks suggest adding difficulty levels, special abilities, critical hits, and a combat history log for enhanced gameplay experience.

Uploaded by

8p4j5hc4xt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

A Level Programming Challenge:

RPG
Scenario:
Your challenge is to create a text-based RPG simulator where players choose and
control characters to battle until one is defeated. Characters can attack, take damage,
and use class-based special abilities. You can decide the setting - this could be a
magical land, the ocean, outer space etc. and the story behind the game.

Challenge Objectives:
Essential Tasks:
 Define a Character Class
- Include attributes for name, class_type, health, and strength.
 Add a method to take damage
- Create a take_damage(self, damage) method that reduces health by a given
amount.
- Ensure health never drops below zero.
 Create at least two characters
- Instantiate two characters with different names, classes, health, and strength
values.
- Display their initial status.

Developing the game:


 Instantiate at least 2 more characters
 Implement the contest
- Write an attack(attacker, defender) function that reduces the defender’s health by
the attacker’s strength.
- Print combat updates showing who attacked and the new health value.
 Add player interaction
- Use input() to let the user choose which character attacks each turn.
- Display a menu of characters and current health each round.
 Repeat the contests until a character’s health is 0
- Use a loop to continue the fight until one character’s health reaches 0.
- Declare the winner at the end of the battle.

Extension Tasks:
 Difficulty levels
- Add a function to set "Easy", "Medium", or "Hard" modes.
- Adjust characters’ health and strength based on difficulty.
 Special abilities
- Each class should have a unique ability (e.g., Warrior can block damage, Mage can
cast a fireball).
- Use input to allow players to trigger abilities.
 Critical hits
- Add a 20% chance to do extra damage during any attack.
- Use random.random() and random.randint().
 Combat history log
- Store each action (e.g., attack or ability use) in a list.
- Display the full combat log at the end of the game.

You might also like