Welcome to ENGG1340/COMP2113 project group 181!
- Ho Chun Fai (3035789124)
- Tseung Kai Fai (3035787085)
"Novice Adventurer - Road to the Abyss" is an endless fight and survive turn-based role-playing game (RPG). User plays the role of a novice adventurer, explore different areas and fight with monsters.
Fight with evil monsters and survive!
- It is a turn-based game, which means in a battle, player and monster would take turn to action.
- Player can choose to attack, use mana skills, or escape. Similar to monsters (but without escape option) (which would be controlled by computer).
- There are two ways of ending a battle, one is escape and another one is the HP of one side falls below (or equal to) 0, i.e. died.
- When one side escape or died, the other side is considered the winner of the battle.
- If the player wins, he/she would be awarded with exp.
- After reaching the required exp, the player would level up. The status would increase.
- After reaching specific levels, the player would be awarded with a trait point.
- He/she can use trait points to enhance their status.
- When the HP of the player falls below (or equal to) 0, i.e. died, he/she would be retrieved but he/she would lose all xp.
- Background story
- Player creation
- Save/load module
- Status module
- Player
- Basic information (name, gender)
- Normal status (hp, mp, att, def, crit, etc.)
- Xp system (level, xp, required xp)
- Trait system (every 5 levels gain a trait point and can be used in strengthening status)
- Monsters
- Basic information (name, gender)
- Normal status (hp, mp, att, def, crit, etc.)
- Extra information (xp drop)
- Player
- Region module
- Require minimum level to unlock different regions
- Player can choose which region to enter
- Different regions with different monsters having different level and status
- Monsters having random level and status, but bounded by limits
- Battle module
- Actions to choose (attack, mana skills, escape)
- Randomness (e.g. critical attack)
- Winning award (xp)
- Generation of random game sets or events
randomNumber()
inusefulF.cpp
usingrand()
andsrand(time(NULL))
to generate a random number between 2 integersrandomNumber()
is heavily used inmonsterCreation()
increature.cpp
to spawn 'random' monsters with random stats- critical attacks, and successful evasion determined by using
randomNumber()
, checking whether the result falls between a specific zone
- Data structures for storing game status
- A struct storing all status of the character
- A struct storing all status of the monsters
- Dynamic memory management
- Using dynamic memory management to store monster status (See
Battle()
inmain_UnixLike.cpp
) - Monster status would be immediately deleted after battle finish avoid high usage of memory
- Using dynamic memory management to store monster status (See
- File input/output
- reading and saving player stats using ifstream and ofstream, saving the file in .sav format
- Program codes in multiple files
- separating codes of different parts and combining them using “Makefile”
- custom header files linking all parts
- Download all files into your computer
- Open your computer's terminal, and go to the directory where the files are stored
- Enter "make main_UnixLike"
- Enter "./main_UnixLike" to run the program
- unistd.h
- used in
getch()
in fileusefulF.cpp
getch()
is used to mimic the effect ofgetch()
in headerconio.h
(unable to use in CS server), which is to read a single character from the keyboard- serve for creating a selection table, when user press the arrow button on the kwyboard,
getch()
can detect what key is pressed
- used in
- termios.h
- used in
getxy()
andgetch()
in fileusefulF.cpp
getxy()
is used to get the current position of the cursor- both serve for creating a selection table,
getxy()
- used in
According to requirements:
You should make sure your code can be successfully compiled in the Computer Science department's
academy11
server or theacademy21
server. Please indicate which of the two servers you have used for testing in your project documentation.
We tested our code and it successfully compiled on the academy21
server.
According to https://moodle.hku.hk/mod/forum/discuss.php?d=630243:
Plagiarism is defined as the use of another person’s work as if one’s own without due acknowledgement.
We searched online and found many useful functions that can help us in developing our codes, we would like to acknowledge them:
- https://stackoverflow.com/questions/1670891/how-can-i-print-a-string-to-the-console-at-specific-coordinates-in-c
- https://stackoverflow.com/questions/4062045/clearing-terminal-in-linux-with-c-code
- https://stackoverflow.com/questions/50884685/how-to-get-cursor-position-in-c-using-ansi-code
- https://thoughtsordiscoveries.wordpress.com/2017/04/26/set-and-read-cursor-position-in-terminal-windows-and-linux/
- https://stackoverflow.com/questions/158585/how-do-you-add-a-timed-delay-to-a-c-program/9747668
- https://stackoverflow.com/questions/2971254/c-sleep-and-loops
- https://stackoverflow.com/questions/421860/capture-characters-from-standard-input-without-waiting-for-enter-to-be-pressed
- https://stackoverflow.com/questions/9158150/colored-output-in-c
- https://en.wikipedia.org/wiki/ANSI_escape_code
The credits are also included in the codes.