This was a small project initially made for my college portfolio but that I felt has been developed far enough to deserve a place here. The core gameplay consists of selecting a "Geo" (of which there are two choices, a circle or a square) and then fighting a randomly-generated enemy. The idea is that, should the player select one Geo, the chances are skewed towards selecting the opposite type. Each Geo has different stats. Circles have 100 health but 1.25x damage, while Squares have 125 health but only 1x damage.
The game provides both you and the enemy with a randomly-generated set of moves. Each side gets 4 moves, two of each type, including:
Physical, of which circle geos are weak to
Magic, of which square geos are weak to
A weakness provides 1.15x damage to an attack. The way the weakness boost and circle damage boost interact is that they are multiplied together before being multiplied to the move's damage.
Victory can be achieved once you have reduced the enemy's health to 0 or below, and a loss occurs as a result of the same occuring to you.
The source code of GeoRogue can be found here!
An early build of the game, showcasing how the battle UI looks. One glaring issue is that I hard coded text labels rather than creating a function that I could slot in whenever I needed to create a changing text label.
This is an issue because Pygame does not use nodes or objects, resulting in a label rendering incorrectly when its value changes in-code. My hard coded solution was to render a white rectangle on-top of a label immediately after it is rendered every frame, allowing for the text label value to change and covering up any previous value.
The selection menu that the player is greeted with upon launching GeoRogue. It uses a config file that refreshes every launch, temporarily saving the selected Geo so that the game knows which Geo was selected throughout all three scenes of the game. The only progress saved across launches is the number of victories.
The intention here was to teach myself how to use Python's file I/O module in the context of a greater project.
One interesting issue with Pygame is that it does not provide an easy-to-use button creation function. I initially tried to find one online but ended up creating my own solution. Buttons are simply grey rectangles with a text label rendered in the centre. When the mouse enters the rectangle, it darkens to signify that the user is hovering over it.
All buttons were placed within an if statement in the game's running loop that looked out for a MouseButton1 event, with a second if statement for each button looking to see if the player's mouse was hovering over it.