Course:CPSC312-2023/dungen-crawler

From UBC Wiki


Authors: Melika Soltaniseresht, Hasan Siddiqui, Andrew Cheah

What is the problem?

Players are allowed to choose their own stats (HP, DMG, Bleed, Life Steal, Priority), and then face against a default monster. The player fights the monster in an animated battle, and then either wins or loses. If they win, they progress to a level-up screen and choose a stat to increase. After leveling up, the player progresses and fights a new monster stronger than before. If they lose, the game ends. After defeating an enemy and selecting an item the user is automatically advanced onto the next floor where the enemy is more difficult to defeat. The goal of the game is clear as many floors as possible.

What is the something extra?

We used the Gloss API to implement a GUI for the game. The game consists of series of animations and scenes as well as user input for the keyboard and mouse.

What did we learn from doing this?

We learned that functional programming can be used to emulate an imperative/side-effect based program. Through the Gloss API World abstraction, we introduced a modifiable state that kept track of the game's state and allowed for the animations and transitions. Our evidence for this claim is that we were able to use object oriented concepts and practices (getters, setters, class constructors).

While functional programming was capable of implementing this game, object oriented languages such as Java or Javascript would have been better suited for this task. For example, Three.JS a JavaScript library provides much easier animation capabilities through matrix transforms of vertex points with respect to certain coordinate frames, this allows for ease in animation, while we had to do such computations ourselves and sometimes, create whole new models for different positions. While Gloss may yet implement such features, the complete lack of any kind of animation libraries with such functionality in Haskell makes Haskell unsuitable for such a GUI focused implementation.


The link to repository