Giter Site home page Giter Site logo

jadventure-refactoring's Introduction

Description

JAdventure is a Java (text) based implementation of a Role Playing Game (RPG) - Single Player.

Project Background

It was originally created as a project of the progether subreddit and worked on by Applzor, add7, geniuus, Malfunction, bdong_, Qasaur, and tamul. It was revived by Hawk554.

Project Status

Under Construction This project is in a alpha status. The player can walk through the game, find items and fight with some nice characters!

Developers are Welcome

Everyone is welcome to help with the creation of JAdventure!

The best way to find out more about the game and the ideas that are there, is to have a look at Reddit - JAdventure.

Or drop by at our IRC channel reddit-progether

All documentation is avaiable from the JAdventure wiki and from the JAdventure website. These form the majority of the project's documentation and development guidelines.

Contributors

  1. Hawk554
  2. projectdelphai
  3. CageHN
  4. kzisme
  5. blackwolf12333
  6. MikesNorth
  7. pthayer3
  8. Reinecker
  9. tamul
  10. shkesar
  11. paddatrapper
  12. Dev-Osmium

Contributing

Don't make a pull request to the main repo's master if you don't want your commit merged yet. Don't make pull requests if you're not willing to merge that code.

Rather than opening a pull request, consider opening an issue to discuss the problem you're fixing. Keep the work-in-progress updates to your fork, maybe merging the updates to a separate branch in the main repo if there's enough there to warrant it.

  1. Create an issue (optional)

  2. Fork the codebase

  3. Clone your fork

  4. Create a branch

    git branch <branchName>
    git checkout <branchName>
    
  5. Make your changes

  6. Push to your branch

    git push origin <branchName>
    
  7. Make a pull request between your branch and the progether master

Setting Up The Game For Development or Gameplay

Gameplay

  1. Download the game from here
  2. Extract the game files
  3. Go into the game directory and run java -jar jadventure-XX.jar (where XX is the version)

Run with Maven - Developers

  1. Install Maven
  2. Go into the game directory and run
    $ mvn test
    $ mvn exec:java
    

to play the game.

Maven has other useful targets such as mvn compile to compile and mvn install to install a copy of JAdventure and all its dependencies to the local Maven repo on your machine.

Playing the Game

To start a new game:

start

To save a game:

s

Get a list of commands with:

h

To get a list of monsters around you:

m

To view details about your player:

v <s,e,b> - view status, equipped items, backpack

To quit the game:

exit

To move:

g n - go north
g s - go south
g e - go east
g w - go west

To pick up an item:

p <itemName>

To drop an item:

d <itemName>

To equip/unequip item:

e <itemName>
ue <itemName>

To attack:

a <monster>

To look around:

la

To talk to a Non-player Character:

t <npc>

Coding Standard/Convention/Style

To help make code more readable, understandable, and consistent, each contributor should follow the set guidelines laid out below. If you disagree with something or come across a style that has not been decided upon, make an issue or a pull request respectively for discussion on the best style. The standard will be decided based on either majority rule or official documentation (i.e. oracle coding standard).

  1. Spaces not tabs
  2. Space width is 4
  3. No beginning/trailing empty lines
  4. Each file should start with an import statement if necessary single-spaced
  5. After class declaration and between class methods, there should be a space.
  6. Within methods, there should be no spaces unless to separate specific chunks of code (i.e not for if statements, return values, or loops)
  7. Opening curly braces appear a space after the closing parentheses, not directly after.
  8. Closing curly braces appear on own line unless followed by an else etc. which will be a space after the curly brace.
  9. Comments should have one space after "//"
  10. Comments 4 lines or greater in length should be multi-line commented

jadventure-refactoring's People

Contributors

0mbi avatar avaloni avatar blackwolf12333 avatar busybob avatar cagehn avatar coldsauce avatar danhenry4 avatar dependabot[bot] avatar freakazo avatar hawk554 avatar indivisible-irl avatar kadensotek avatar ketdougi avatar kgarsuta avatar kzisme avatar mikesnorth avatar mtayler avatar muirrum avatar nicce avatar owenbc avatar paddatrapper avatar projectdelphai avatar pthayer3 avatar reinecker avatar ronan-h avatar sgoudham avatar shkesar avatar the-host avatar verhagen avatar vijaivir avatar

Watchers

 avatar  avatar

jadventure-refactoring's Issues

Long Method in Entity Class

Code Smell Type: Bloaters, Long Method
Detection Tools: IntelliJ IDE PlugIn SonarLint
Location:
File- entities
Class- Entity
Method- equipItem
Screenshot:
Entity, long method 1
Entity, long method 2

Unit test coverage:
The equipItem method is mostly covered by unit tests in EntityTest. However there is not a test that covers the case when an item is being equipped in a location that already has a item therefore we will make a test for this case.
entity, test coverage

Plan for refractor:

  1. Add test in EntityTest for the case when an item is being equipped in a location that already has a item
  2. Use IntelliJ's built in refactoring tools to extract a method from lines 193-211 of Entity class
  3. Rerun test to ensure that functionality did not change due to refactoring

Duplicated Code in Player Class

Code Smell Type: Dispensibles, Duplicate Code
Location:
File- entities
Class- Player
Method- printStatChange
Screenshot:
Player, Duplicate code

Unit test coverage:
The printStatChange method is not currently covered by unit tests.
Player, Test Coverage

Plan for refractor:

  1. Add unit tests that cover each case of the switch case block
  2. Use "Extract Method" to remove the repeated if block and replace other instances with the new method.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.