联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Database作业Database作业

日期:2025-01-18 06:39


AA2 - Minimal RPG

Program a minimal RPG game that runs in the windows

console using CMain Objective

Create a minimal RPG that places the player in a dungeon filled with enemies and riches

Evaluation

The assignment consists of 6 parts. Each part has a set of items that must be implemented

to reach the maximum grade.

Player and enemies (1 point) 2

Main Manager (2 points) 4

Dungeon (2 points) 6

Combat (3 points) 8

Chests & Gear (1.5 points) 12

Victory / Defeat (0.5 points) 14

1Player and enemies (1 point)

Player

The Player must have the following information and stats

Position

The position of the player must be stored as an X and Y coordinates.

It is recommended to create a struct called MapPosition to store this kind of information

since it is also used with enemies and chests.

Gold

Used for the final score, gold represents the wealth of the character. Whenever a chest

is opened or a weapon is looted we earn gold.

Health

Main resource of the character, if it reaches 0 the player loses the game. It does not

regenerate between fights.

When creating the character, the health value must be initialized randomly between 90 and

110.

Stamina

Used in fights. It does not regenerate between fights.

Stamina is initialized randomly between 90 and 110.

Agility

Determines how many moves a player can do before all the enemies move.

All players start with 3 points of agility, translating into 3 moves before the enemies

move.

Potions

The player can hold a maximum of 3 potions. Using a potion will restore 40% of the

maximum health of the player.

Example: If I use a potion and I have 20 health out of 100, I will restore 40 health, setting my

current health to 60.

2Enemy

The Enemy must have the following information and stats

Position

The position of the enemy must be stored as X and Y coordinates.

It is recommended to create a struct called MapPosition to store this kind of information

since it is also used with enemies and chests.

IsDead

Flag to store if the enemy is dead or alive. An enemy will always be spawned alive.

Health

Main resource of the character, if it reaches 0 the enemy dies.

When creating an enemy, the health value must be initialized between 60 and 90.

Stamina

Stamina is used in fights.

Stamina is initialized between 60 and 90.

3Dungeon (2 points)

The dungeon is a 5 x 5 maze where the player can:

● See where the player, enemies and chests are located.

● Move around

● Use potions

Render

The dungeon must render in the console something resembling this layout:

4As we can see the layout has the following elements:

1. Scene name

2. Legend of the map

3. Player stats

4. Map

5. Player actions

Movement

The player must be able to move when entering any of the WASD keys. Moving

consumes 1 move. Remember that the max moves are determined by the player's agility.

● If a player wants to move left and already is on the left-most tiles of the map, the

command will be invalid. The same goes for top, left and right commands.

● If a player moves into an enemy, the player will start fighting that enemy.

● If a player moves into a chest, the player will loot the chest.

● Looting a chest or fighting does not reset the player’s moves.

Potions

The player can use one move to consume a potion, healing the character for 40% of

the max health value.

● If the player tries to use a potion without potions, it will count as an invalid move.

Any command entered other than W, A, S, D and P will be considered an invalid

command and will ask the player to enter a new command without consuming agility.

Enemy Movement

When the player's agility reach 0, the enemies will move randomly.

● Enemies cannot move on top of non-looted chests.

● Enemies cannot move on top of the player.

● Enemies cannot move on top of each other if both are alive.

5Main Manager (2 points)

The Main Manager is the element that coordinates the game behavior. It tracks the current

game state (Fighting, in the dungeon, looting a chest…).

Extended flowchart: https://drive.google.com/file/d/15zO1wCf7bnpao8uNmVuHC1V6OcCQMlvT/view?usp=sharing

As we can see, there are 4 main scenes that are connected. The Main Manager must track

the current scene and store any variables needed between the scenes themselves.

6Spawning

The Main Manager is also responsible for the spawn of the player, enemies and chests.

Player

● The player will also spawn in the lower center of the dungeon.

● Only 1 player spawns

Enemies

● Between 5 and 7 enemies spawn

Chests

● Only 2 chests spawn

The player, enemies and chests cannot spawn on top of each other

7Combat (3 points)

The combat is based on 3 actions:

● Attack (Consumes stamina for a set amount of damage)

● Defend (Regenerates 25% stamina and mitigates 75% of the incoming damage)

● Rest (Regenerates 100% stamina but leaves you vulnerable to attacks)

● Potion (Same conditions as previous descriptions)

If both characters attack, the one with the highest value will strike the other one and

stamina is consumed.

Example: I attack with 50 stamina and the enemy attacks with 67 stamina.

● I receive 67 damage

● I lose 50 stamina used for the attack

● The enemy loses 67 stamina used for the attack.

Render

The combat should display

● Enemy stats (visual bars are required for maximum score)

● Player Stats (visual bars are required for maximum score)

● Player Actions

8When the player enters an action, a combat log will appear at the bottom.

Once the fight has been simulated, the player should be asked for an input to refresh the

screen.

9Combat logic

Extended flowchart: https://drive.google.com/file/d/1q2y-RpqoCdRGLj0Dlr-G5sBXlfqhPJew/view?usp=sharing

10If the player loses all the HP, the game will end. If an enemy loses all of its HP, the

following things happen:

● If there are no more enemies or chests left, the game ends

● If there are still enemies alive or non-looted chests, the player goes back to the

dungeon.

Enemy logic

The enemy will decide its combat action following this flowchart.

When attacking, the enemy will use between 20% of the max stamina and the current

stamina level.

For example, an enemy with 100 stamina should never attack with less than 20 stamina.

11Chests & Gear (1.5 points)

Gear

Gear are unique items that the player can find inside chests. Gear will modify the health,

stamina and agility attributes of the player as well as having a gold value. This value

counts towards the final score. Notice that gear can also reduce the player attributes!

Gear example:

Richard’s Hatred | 200g value | +20 HP +40 Stamina +1 Agility

Swift boots | 10g value | -10 HP -5 Stamina +1 Agility

White Powder | 150g value | -20 HP +20 Stamina +1 Agility

Radev’s Mug | -300g value | -20 HP -40 Stamina -1 Agility

Raven feather | 50g value | -10 HP +2 Agility

Red Mushroom | 170g value | +30 HP

Ugly Facemask | 10g value | +5 HP

Broken Shield | 25g value | +10 HP

Green mushroom | -50g value | -10 Stamina

Naughty book | 69g value | +7 Stamina

Chests

Chests contain gold, gear and sometimes a potion. They have the following attributes.

Position

Position of the chest in the dungeon.

It is recommended to create a struct called MapPosition to store this kind of information

since it is also used with enemies and chests.

Gold

Amount of gold that the chest contains. Randomized between 50 and 200 gold.

IsLooted

Flag that indicates if a chest has been looted by the player. All chests are not looted

when spawned.

Gear

Attributes of the gear that the chest contains.

ContainsPotion

Flag that indicates if the chest contains a potion. 25% of the chests contain a potion.

If a chest contains a potion the player will take it if there is enough room for it. If not,

the player cannot take or use the potion inside the chest.

12Render

Render of a chest that does not contain a potion

Render of a chest that contains a potion

The render parts are

1. Amount of gold

2. Gear data

3. Potion data

13Victory / Defeat (0.5 points)

This last part is an end screen that is displayed when the character dies or clears the

dungeon successfully.

Example of a defeat screen:

Example of a victory screen:

Remember that the score displayed is equal to the gold that the player has collected

plus the value of the gear.

14Requirements, delivery and sancions

● Delivery is due on January 17 at 23:55

● The work is done in pairs. These must be announced on 11/15/2024 in class. If a

student does not have a partner, one will be randomly assigned to him/her.

● The name of the project must be:

- AA3_“Name1Surename1”_“Name2Surename2”_PROJECT.

● The name of the solution:

- AA3_”Name1Surename1“_”Name2Surename2”_SOL.

● The delivery must be done through Moodle by both members. Delivering the

project with the solution and, optionally, a .txt with the nomenclature “README” if the

student wants to clarify any detail of his work.

● Both the project and the .txt file must be compressed in a .zip file with the

following nomenclature: AA3_”Name1Surename1”_”Name2Surename2”.zip

● The use of ChatGPT or similar is allowed for consultations on the subject, as

long as the content is reviewed and never copied textually. If the teacher interprets

that the code could have been generated with AI, he/she will interview the student

to validate that the content is his/her own. Otherwise it will be counted as a copy

and therefore a 0.

● The project must compile, otherwise it is automatically a 4.

● If the project has a fatal error during execution, -2 for each of them.

15


相关文章

【上一篇】:到头了
【下一篇】:没有了

版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp