ucsb-cs56-projects / cs56-games-roguelike

-
5 stars 13 forks source link

cs56-games-roguelike

This is an ASCII roguelike game. If you are not familiar with the "Roguelike" genre, the Wikipedia entry can give you some background:

http://en.wikipedia.org/wiki/Roguelike

Project History

 W14 | andrewberls 4pm | rick-lee | ASCII roguelike game
 W15 | dcoffill 6pm | dcwang | ASCII roguelike game

(Updated Gameplay Screen as of 12/6/17)

High-level Description

This project currently functions where the user is a player trying to survive waves of enemies. The player gains points and progresses the level by defeating monsters. Advancing level increases the difficulty of the monsters. At the start of each level, most of the area is be pitch black and needs to be "discovered" by the player.

Features and Gameplay Guide

This Roguelike game is a single player dungeon game. It incorporates many features outlined by the "Berlin Interpretation", a rubric for judging the similarity of a Roguelike game to the original Rogue game. Berlin Interpretation features in our game include a birds-eye-view of the map, player and monster representation by ASCII characters, random environment genration, permadeath, turn-based gameplay, grid-based map, hack'n'slash style, and exploration/discovery. Unlike the original Rogue game, this version does not have multiple rooms connected by corridors. The map of this game can be viewed as one rectangular room.

The player is represented on the screen by the @ character. There are currently 7 types of monsters in the game: Bat, Golem, Monster, Pirate, Snake, Troll, and Zombie. On the screen, the monsters are represented by their intial (i.e. Bats show up as B, Golems as G, etc.). There is a pre-set maximum number of monsters in each level, and there can be multiple instances of one type of monster.

The player begins each level by starting in the middle of the map, with all but his surrounding tiles enshrouded in darkness. The player "discovers" the rest of the map by navigating using WASD. Monsters also move around in random patterns. Note that the game is turn-based in that monsters move once every time the player moves. The player attacks by moving directly adjacent to a monster, and then pressing the arrow key that would move the player onto the same tile as the monster if it were not there. The player can be attacked, and hp lowered, by a monster when the monster does the same thing to him.

When a monster dies, there is a 20% chance of it dropping a health potion (icon H, gives 20 hp), 20% chance of dropping beef (icon +, increases player's attack power), and 15% chance of dropping poison (icon !, gives -20 hp).To consume an item, simply move onto it.

As soon as all the monsters of a level are killed, the player is automatically teleported to the next level. Reaching higher levels increases the strength of the monsters. When the player reaches 0 hp, he dies permanently, and his score, along with the current highscores, will be displayed. The game can be replayed by closing the game window and performing the "ant run" command again.

A good strategy for killing monsters while avoiding taking damage is to take advantage of the way monsters move. Monsters move one turn at a time in the same manner as the player. The player should only spend time adjacent to the monster if he is attacking it; otherwise he risks taking unnecesary damage.

Program Internals

RogueController.java has the MAIN class.

RogueController deals with user input and calls methods accordingly. It creates two objects: RoguePanel and LogicEngine

RoguePanel draws all the characters and UI on the window.

LogicEngine calculates all the movement and game logic of the player and monsters. It creates objects: Player and Monster with all Monster subclasses.

The current level of the game is managed by the int variable level in LogicEngine

GUI.java is the class that creates the main menu interface.

-Player

Player is created and dealt with in the LogicEngine class

Player specifications can be modified in Player.java (i.e. HP, attack)

The Player is created and its location is set in the method createAllObjects() in LogicEngine class. The method createAllObjects() is called in the LogicEngine constructor.

-Monsters

All monsters are created and dealt with in the LogicEngine class

Current monsters in the game: [ Bat , Golem , Monster , Pirate , Snake , Troll , Zombie ]

The list of monsters is maintained in LogicEngine.java as a private variable:

    private Monster[][] listOfMonsters;

The LogicEngine.java constructor created the list:

    listOfMonsters = new Monster[floorWidth][floorHeight];

Monsters are created in the createMonsters() method in LogicEngine.java. The method checkAllMonsterStatus() in RogueController.java calls this method

The maximum number of monsters per level is maintained by maxNumOfMonsters int variable in LogicEngine

Monsters' increase in difficulty per level is set by setLevelBonus(int level) method in Monster.java. This is called in LogicEngine.java when monsters are created by createMonsters()

-Items

Items have been implemented into the game. There are some files already created : Beef.java , HealthPotion.java , Item.java , Poison.java

Future Improvements

How to run the project

Navigate to the directory with the build.xml.

Type ant run

W16 Final Remarks

Hello CS56 W17 students! You've been assigned a pretty cool project so smile. Some things you should know before starting to work on this project are:

Sincerely,

Josue and Ish.

F16 Final Remarks

This project is quite far along in terms of having an entertaining game. At this point the types of changes that you will make will be adding new features and refactoring old code.

Things to add to the game

We recommend first fixing the issue dealing with elixir being able to jump over walls and monsters, as it should show you the interaction between different classes to make the game run.

Have fun!

-Max and Artem

F17 Final Remarks

This project is lit! I hope you enjoy all the changes that have been made so far and I hope you can take care of this little project.

NOTE: Please Add JavaDoc Comments as you go, this will make it easier for the next classes to read Also, if you do add story text, please make it interesting. The instructions in this game before were pretty boring so try to keep it spicy :) Enjoy my dudes :D

Fall 16 Mentor Asssessment

The code for this project is reasonably well designed. However, it falls into some of the usual traps made by developers using OOP for the first time in a real capacity. The biggest one is that each item and monster is its own class. For instance, the Bat (extends Monster) class is just a collection of constructor overrides. That is to say, all its functionality exists in the Monster superclass, and you can create a Bat by creating a Monster with the specific stats of the Bat. Some possible refactors are static factory methods (Monster.createBat()) or storing each Monster 'class' in a file. Another is that the Player class is wholely separate from the Monster class, despite them being reasonably similar. Instead, they could be one class, and the player controls a single specific instance of this GameEntity class. The last major problem is that drawing the game state to the screen is fairly coupled to the actual logic of the game. These should be split so that changes to existing game logic doesn't break rendering.

F17 Final Remarks

Hey new CS56 students, so most of the stuff you need to know about what the project is and does is listed above this remark, any new things that would be helpful are:

What features could be added include:

What bugs exists include:

Opportunites for refactoring:

F17 Final Remarks(pt2)

Heres a few tips for the new CS56 Students working on this project:

Understanding the code:

Things you could work on:

There arent too many bugs left in this code, but there are numerous improvements that can be made to the code and new features that can be added. With this in mind, good luck on this project!

W18 Final Remarks

Hey future CS56 students!

We recommend that the first thing you do is download an IDE to edit/view the Rogue program, such as Intellij. Intellij is free and also great for easy refactoring, finding usages, and safe deletions.

At the current state of the game, there are definitely a few bugs to work out, sometimes the game will randomly freeze in the middle of game play. We don't know why. That's up to you to figure it out! We think it has to do with map generation, but we are not entirely sure.

We also noticed that a lot of the code has potential for refactoring, especially the LogicEngine, RoguePanel, and RogueController classes.

We mostly fixed up the GUI in this iteration, we recommend the next group work on Bosses, Combat, and Bugfixing.