Continuing from the last blog post Third pull request for Hacktoberfest . I found a different project written in Java. Unlike the other projects, I was able to have some discussion with the creator of the project through discord.
The project I will be working on is called Norii. Norii is a Turn Based Strategy RPG written in Java using the game development framework libgdx. I have used libgdx before in my free time so I was fairly confident that I was able to complete the issue at hand. Turns out the issue was harder than I originally thought, resulting in more days of development.
Looking for Issues:
The original issue I wanted to work on was a bug. The issue talk about how resizing the window for the game messes up the positioning of the action menus in-game. Looking at this problem I thought of a different solution, instead of fixing the actions menus to re-position themselves after the game has been resize why not just make the game window non-resizable. I listed my reasons why on the issue:
- Less effort to implement
- Usually games aren’t resizable (if they are, they usually provide the dimensions)
- There are many other places other than the action menu that has this problem. For example the main menu’s button and text are stretched when you resize the game menu. Hence more implementations
The creator of the project responded to my comment saying that yes in hindsight it would have been better to implement a non-resizable game window but a lot of implementation has already been put forth for making the game resizable. I decide to leave this issue and focus on a different issue in the same project instead.
The issue I will be working on is an enchantment. Issue title: “Pressing escape should open up a menu, which allows to go back to the main menu, change settings (not available yet)“. I will be implementing a pause menu that will appear when pressing escape key. The pause menu will have the ability to resume back to the game, go back to the main menu and go to the setting menu.
Implementing the solution
Implementing the pause menu was not that difficult since I have had experience with libgdx framework. I did learn some new classes/functions that I never used before that this project used. Here is the result of what I created:
The background for the pause menu is just a template, since I am not very keen on design. I made it so that the creator or other contributors can easily replace this image for a proper pause menu UI.
Once I finished implementing the pause menu, I went to test to make I did not affect any other functionality. I realized while testing if you use the pause menu to go to the main menu screen and go back to the play state screen you are unable to play the game. After a long time of debugging I was unable to find an answer, I decide to message the creator of the game on discord.
I decide to record the problem I was having and upload it on YouTube as an unlisted video to show on the discord channel.
As you can see I was able to create units at the beginning of the play state, but after using the pause menu, going back to the main menu and recreating a new play state I am unable to create new units.
There is also the problem with the pause menu in where the game isn’t actually paused. I want to get the creators opinion on this first before I start to implement this part.
I have not created the pull request just yet because of the trouble in testing. I am waiting on the creator of the project to reply to me to continue with this implementation. If I am unable to get a reply today, Ill be working on a new issue tomorrow to meet the Hacktoberfest goal.