This weeks task was to experiment and implement a better User Interface. I used pyglet to make a simple GUI, which currently has the same functionality as the terminal version. It’s still just text so far, creating GUI from scratch takes time, but adding more graphics and animation is now possible. Had to spend a decent amount of time refactoring, making sure the core package, which contains game logic, was completely separate from any terminal specific code. I also spent a little time balancing stats and the 4 skills currently available, so that the game is playable and all 4 skills have purpose.
Terminal version
The old interface in terminal looked like this:
GUI version
The new GUI version (WIP!) looks like this:
It is a little rough around the edges, but has mostly the same functionality as the terminal version. Some obvious next steps are:
- Print messages character by character to better guide attention
- Frames around different text boxes
- Replace the textual stats and battle screens with prettier graphical representation
- Green and blue health and mana bars instead of text
- Bars / numbers can be animated for damage / healing / exp gain etc.
- Simple sprites for player and enemy
- More interesting backgrounds
Next week
The plan for next week is to work on effects, i.e. buffs and debuffs caused by skills which last multiple turns. I’ll try to stick to this plan, but I might get back to doing a little more GUI if I finish early.
Changelog
For the extra interested I’ve generated a changelog based on my commit history:
- GUI: Better default option when going from one menu to another
- Experience gain is now printed after adventure success message
- Added a message when meeting a new enemy in adventures
- Added hello message when creating new character
- Skills are no longer printed in battle
- Player now starts with 4 skills
- GUI: Separate labels for battle stats
- GUI: Moved GUI class to separate file
- GUI: Enter and navigation in menus
- Animation based on character width
- Font options for Mac OS X
- Up and down working in GUI menu
- GUI: Menus (rendering only)
- GUI: Better fonts and spacing
- GUI: Backgreound and title text
- Big refactorings to enable GUI
- Removed unused arguments
- Added small banner to main menu
- Removed game over exception
- Removed level and skills from character creator
- Balanced out starter stats
- Case insensitive skills
- Balanced the 4 basic starter skills
- Windows compatible clear
- Clean up imports
- README
- Skill collection system
- YAPF for formatting
- Sane importing/module behavior
See github.com/olehermanse/mrpg for more details.