Skip to content

jcomp-03/jest-another-RPG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT

jest Another RPG

Project Description

This app demonstrates a foray into fundamental programming paradigms such as object-oriented programming (OOP) and test-driven development (TDD), or using automated testing to verify one's code works as expected. The JavaScript testing framework used in this app is Jest, which was developed by Facebook and is well-documented. Mocking data is also implemented to nullify the concern about isolation testing with respect to players and potions. The focus on OOP in this app lies in creating several different classes, a parent class and several children classes which extend from their parent, allowing the children to inherit methods and properties from the parent. Constructor functions allow for the creation of instances of the different objects--in this case, the Game constructor which begins a new game, the Player and Enemy constructors which create instances of player and enemy objects, and the Potion constructor which allows for the creation of potions with various effects.

Table of Contents

Installation

After cloning or downloading a local copy of the repository, from a terminal install the required dependencies that are listed in the package.json file:

npm install

Once the node_modules folder is created and all dependencies are downloaded, type the following in your terminal:

node app.js

The app should successfully run after having typed the above.

Usage

Follow the prompts from the command line to run the game. Here is a snapshot of how the app looks
A snapshot of the app midway through gameplay

License

Copyright 2022

=======================================


Click for the legal stuff, if that's your thing Copyright James Compagnoni

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

Legalese borrowed from here.

Contribute

If you have any comments or questions, please reach out to me. I will be happy to answer any inquiries!

Tests

The app uses Jest to achieve unit testing of class methods and properties.

Questions?

I enjoy hearing back about my work. You can reach me at jcomp_03@yahoo.com. Alternatively, contact me on my GitHub page here.

Releases

No releases published

Packages

No packages published