This repository for a R/Python Unicode text-based/rouguelike game that I created. This project is ongoing and new features and refinements will be made in the future.
The objective is to descend to the bottom of a randomly generated castle (represented as a 3D Array) while avoiding a zombie. To do so, you need to interact with the doors and defeat all monsters on the floor to reveal the door to the next level/exit. These doors may contain monsters, genies (which increase your attack or reduce the cost of mana for your enhanced attack, or faries (which heals you). Deafeating monsters earns you money and random item drops. Money can be used to purchase items, which may assist you through the game, from the merchant.
The Python version only works on Windows PCs since it relies on the msvcrt module, which is only available on windows, to flush player inputs. Additionally, the numpy module is needed to run this game.
Only RStudio and the rstudioapi package (for player input) is needed to run this game.
While in the same folder containing start_game.py
in your Terminal, run:
python3.10 start_game.py
Open start_game.R
in RStudio and run the file. Ensure that your current working directory is set to the same directory where start_game.R
is located.
To do this:
-
Ensure that
start_game.R
is open in the source editor (top left). -
Go to: Session -> Set Working Directory -> To Source File Location (or To File Pane Location if the directory containing
start_game.R
is in the File Pane (bottom right). -
Highlight:
source("game_scripts/create_environment.R")
- Click Run.
As mentioned previously, the player's objective is to descent the castle while battling the monsters and avoiding the zombie. The entire game uses Unicode and arrays for visualization.
Player's can navigate throughout the grid using the w
a
s
d
keys. The array is wrapped so that going out of bounds make the player reappear on the opposite side of the grid. If the doors are empty, player's can move through the empty doors. While the player is restricted to four movements (up,down,left,right) the zombie can move in eight directions (up,down,left,right,diagonally). However, unlike the player, the zombie cannot move outside the grid to reappear at the opposite side nor can it move through the empty doors.
Additionally, player's stats such as their current health, mana, and money are displayed at the bottom of the array.
Player's have access to a merchant shop
And the ability to fight monsters for money and items
And the ability to encounter genies for increased attack points