RPG Game

From UBC Wiki

Contents

What is the problem?

We will be implementing a simple RPG game where the players goes through multiple stages (number of stages to be determined) and tries to beat the boss at the end of the game.

At different stages. The users can decide on the difficulty of the monster, which will result in different tiers of stats gain to better fight the boss at the end.

What is the something extra?

A monster with a different name will be generated at every stage. Additionally, based on the difficulty of the monster chosen, the possible distribution of stats that monsters can have will also vary.

Player and monsters will take turns attacking. The player will have the option of performing a strong or weak attack whereas normal monsters will only have the weak attack option. If the player opts to use a strong attack, the risk missing the attack and do no damage.

Finally, the boss will also have the option of performing a weak or strong attack, however, the boss monster performs both attacks and takes the maximum of the to attacks.

What did we learn from doing this?

With the development of our project, we have developed a good understanding of Haskell of a language, specifically:

  • making use of modules and how to import them; creating separate files for separate entities (Game, Monster, Player) where the main game file imports both the monster and player files.
  • IO programming and IO Monad using do-expressions and converting IO data types to their respecitve data types to manipulate them
  • making use of the Maybe class (Nothing / Just <val>)
  • data types and data constructors specific for the objects that we are trying to create.

Links to code etc

https://drive.google.com/drive/folders/1l_kYLOq0pTpIcQ7HyPfrVWixM-q-d5hG?usp=sharing

To run: call ghci and call :l main. Start the game by calling main