Posted October 06, 2023 by Sleepy Geese Studios
#gui #menu #save #load
Codex is a spell-casting heavy metroidvania inspired by The Legend of Zelda 2: The Adventures of Link. Players will unlock spells through exploration and defeating bosses which will enable to reach new areas. I am working with a close friend who is creating the art, while I am focused on the coding. I have purchased the rights to some assets to free up my time to just working on the code.
As of current we have the player functional with movement as well as some enemies and a few spells/items. Some spells have special effects and can be aimed. There is currently basic keyboard support, but I am abandoning it for the meantime because the game should really be played with a controller. Once everything is completely polished for controller use and there isn’t something else to work on, I may bring keyboard support back up to par.
The game is being coded in python and uses the arcade library to do the heavy lifting (physics engine, sprite handling, integrating the rooms etc). For building levels, I am using Tiled and really leveraging the layer system they have in place for if statements in my code. An example would be checking if each object in a particular layer has a specific property and if so execute code based on that property. This way the code doesn't run on every single object in every single layer (performance enhancement).
A recent addition to the game is proper saving/loading being added. The way I implemented this was when a player entered a room, a check would run to see if there were enemies present (save rooms are always clear of enemies) and if so it would a variable called safe as True. Then if the jump button (A) was pushed it would check if the player was making a collision with the save object and finally execute a save operation. At one point the items wouldn't spawn back in correctly and it took a lot guessing and checking to finally get it to translate correctly back.
Additionally, I rebased the moving platform code so now I can mindlessly place them in Tiled and set ranges/speeds for them and they explore that area while being leashed to their start point. Before I had to manually set their left/right limits as opposed to the current which is just setting the leash length.
I also worked on level design and drafted out zone 1 on paper so that I can better plan the coding/design out it. There is also a platforming test level now which we will use to get feedback on the character movement.
Finally, I spent a while trying to use my engine to code a menu using their GUI API, but soon realized that I didn’t enjoy the process, so I used tiled instead and coded a “minigame” which is now the spell menu. I am going to copy it over to make an item selection screen and a game options screen. It will likely be how I implement the minimap as well.
I built an early prototype which I soon realized wouldn’t work for my needs because I want the player to see a description of the spell and see what their currently selected spells are (players will have two at a time, that’s an upgrade compared to LoZ2). Only issue I am having with the current iteration of the spell menu is that the text doesn’t want to render. Thus a near future task will include fixing the spell menu to show the descriptions as well as the titles.
Other near future tasks include, building out the first zone into a playable demo, building out the item and options menus, and coding the first boss. If you have any neat ideas, feel free to post them on our discord in bug reports or comment on here and I'll take a look.