A user will be able to select and action after an encounter Issue Tracker
Flow Diagrams
First milestone.
This diagram shows the basic skeleton of the program and the minimum objectives that the project should deliver. This is a functional yet basic game.
Complete Flow Diagram
The complete diagram below displays the final flow of the game. Uses the skeleton in the first milestone but expands it allowing the player to take actions and randomly triggering encounters depending on the user's input.
The descriptions for each floor are decoupled and store those descriptions in a functions.py file to allow modifying or expanding without impacting the core functionalities.
Features
Playing a game.
Select the action while fighting.
Select the action after a fight happens.
Choose between continuing or exploring for a chance of getting a reward.
Complete the game by defeating the final boss.
Future features
Introduce different type of floors and descriptions. This will achieve by creating a floor class.
Introduce different type of monsters. This will be done by creating a subclass of the player class.
Technology
Python
The programming language for this exercise is Python.
Heroku
Heroku is the platform used to deploy the program and make it accessible to the general public
Github
Github was selected as the version control
Lucichart
Lucichart was used to design the flow diagrams.
Test cases
User starts a game.
User visit local host or Heroku app link
Expected behaviour: The user will be presented with the game banner.
Passed: Upon loading the game displays the game banner with the correct colour style
Expected behaviour: The game will load and the user will be able to enter a name. Validation will ensure only letters are used in the name.
Passed: The user is able to select the name. Validation ensures only characters ares used in the name.
Users select what do during a fight.
Expected behaviour: A user can select Attack, Defend or Heal during an encounter (1, 2, 3)
Passed: User is able to see the combat menu
Expected behaviour: The user will see the result of the action, an incorrect entry will trigger a message stating that the entry is incorrect.
Passed: Input validation
Passed: Action one is recognised and the program display the attack roll outputting if success or not
Passed: Action two is recognised and the program display the correct description
Passed: Action three is recognised by the program and additional validation is done to check if the health points are currently at maximum
User can choose to explore for a chance of getting a reward
Expected behaviour: A user can select one or two in order to continue or risk an encounter to gain a reward.
Passed: Validation is successful, only 1 or 2 are valid options.
Passed: After selecting the option to continue searching an encounter is triggered
User selects what happen after a fight
Expected behaviout: After a fight the user can continue or recover their health point (1, 2). Recovering the health points have a 40% chance of trigger an encounter.
Pass: The after fight menu appears after the fight ends and the player have over 0 Health Points
Pass: After input 1 the program continues to the next scene
Pass: After input 2 the program display the text for heal and if no encounter is trigger it will continue the program
User complete the game defeating the final boss
Expected behaviour: After bringing the last boss's health points to zero the user will complete the game seeing the last description.
Pass: After bringing the final boss to zero health points the game displays the game ending text
The game end when the user Health Points reach zero
If at any point the player's Health Point reach zero the game end immediately displaying the game over message.
Passed: When the player reaches zero health points the game ends displaying the game over message.
Code validation
Python Coding validation. The code run without returning any error and no erros are flagged in pyling
Fixed bugs
Fixing bug UnboundLocalError in attack_roll function Issue21
Fix input validation in encounter function Issue27
Deployment
Heroku Deployment
Navigate and login to Heroku and login it
Click in Settings, under builpacks select:
Python, NodeJS in this order first Python, second nodejs
In Config Vars click in Add and add the following
PORT , 8000
Once that is completed. Click in Deploy
In Deploy Method clink under GitHub
Connect your Github repository to Heroku
At the bottom under Manual Deployment select the Branch you want to deploy. Main by default
Click in Deploy Branch
Click in the View button to open deployed app.
Local deployment
Execute in terminal node index.js inside the project's folder
If there is any errors we will need to install further modules. The most common total, in the terminal entry npm install total
Execute again node index.js
By default it uses local host port 8000 . Navigate in your browser to http://localhost:8000/
Click in run program if the program do not start automatically