Skip to content

iv4xr-project/MiniDungeon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniDungeon

MD instance with lots of monsters
screenshot-2

MiniDungeon is a Rogue-like game, played by one or two players, played in a world consisting of a series of rectangle NxN mazes. The world is tiled where a player can only move from one tile to another. The tiles are arranged to form a square world, from tile (0,0) to tile (N-1,N-1). The tiles on the border of this world are always walls to prevent players from going off the world.

In a multi-player setup, there is a second player. The two players can play cooperatively, or competitively. The game is turn-based, where at every turn a player moves, then all the monsters move. The other player remains idle during this turn. The game engine does not in itself limits players to move in a strict alteration. The game does not support a distributed-mode, so both players have to play on the same computer, using e.g. one keyboard for each.

The game has one or more mazes (configurable). From the starting maze a player can go to the next one by using a shrine. The shrine can only be used if it has been cleansed. It can be cleansed by applying a specific scroll on it, though the player does not know which scroll would cleanse a shrine. Once cleansed, using it will teleport the player to the next maze. Cleansing the shrine in the final maze wins the game for the player.

Monsters are randomly placed in the dungeon. When a monster is adjacent to a player, it will attack the player. Similarly, a player can attack an adjacent monster (or another player). If a monster's hp reaches 0, it will be removed from the dungeon. If the player's hp reaches 0 the player dies and cannot participate in the game anymore. If both players die, the game ends; the monsters win.

There are scrolls and potions randomly dropped in the dungeon. When the player moves to a tile with an item on it, and provided there is still some space in the player's bag, the item is picked and automatically placed in the bag. Player-one's bag can hold two items. Player-two is stronger, but its bag can only hold one item. Once picked up, an item cannot be dropped again until it is used. You can always use a potion, but a scroll can only be used on an uncleansed shrine.

  • Shrines are tainted, and must be cleansed by using a scroll. However, only a holy scroll can do this. The player does not know up front which scroll is holy until it uses it. Using a scroll consumes it.

  • The player can use a potion, if his/her bag contains one. Using a heal potion heals the player for some amount of health point. Using a rage potion double its attack rating for some turns.

Frodo Smeagol Heal-pot Rage-pot Scroll Shrine Monster
Player-1 Player-2 Healing Potion (Yum...) Rage Potion (Roar!) Scroll Shrine Monster

How to build the project

Build with Maven. Just do mvn compile.

How to run the game

Just run the class DungeonApp. It has a main() method. You can use Maven to run it. After you built the project (mvn compile), you can do mvn exec:java to run DungeonApp.

You can configure how many mazes you have, how many monsters, how many healing potions, and so on. The code in the main() shows how to configure the game:

public static void main(String[] args) throws Exception {		
   MiniDungeonConfig config = new MiniDungeonConfig() ;
   // set your configuration here:
   config.worldSize = 40 ;
   config.numberOfMaze = 10 ;
   config.numberOfMonsters = 10 ; // per-maze
   config.numberOfHealPots = 2 ;
   config.numberOfRagePots = 0 ;
   config.numberOfScrolls = 6 ;
   config.numberOfCorridors = 3 ;
   config.viewDistance = 4 ;
   // etc
   var app = new DungeonApp(config) ;
   deploy(app);
}

Controls:

  • Movements: wasd-keys for Frodo, and ijkl-keys for Smaegol.
  • *Using items: e/r for Frodo (using a heal-pot or a rage-pot); o/p for Smaegol.
  • Quit: q

Other screenshots:

An instance with a twisting maze
screenshot-1
An instance with a large maze
screenshot-3
Imposing limited visibility
screenshot-4

Adding more maze shapes

Mazes in MiniDungeon is always rectangular NxN. The game can generate a simple twisting maze, but if you want to create your own maze, check the class eu.iv4xr.minidungeon.Maze. You need to implement a method similar to the method buildSimpleMaze() defined in the class. Such a constructor is invoked in the constructor of the class MiniDungeon(). Check where the method buildSimpleMaze() method in invoked there, and then you can hook in your own maze constructor.

Other things

There is also an implementation of the game in Python. See in ./python. It is implemented using Pygame. There is also an implementation of OpenAI Gym interface. See RandomPlay.py for a simple demo of driving the game through the Gym interface.

Author: Wooshrow
License: 3-clause BSD

About

A configurable Rogue-like maze bashing Java game.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published