Refactoring, always! #001


This has been such a great experience.

After learning most parts of Phaser 3 on the weekend that the game jam in which this game was supposed to be on which didn't actually happen but welp, you may imagine how convoluted its code was. 

My oh my, the pure definition of spaghetti code.

But as the intention of using Phaser 3 was practicing programming and Javascript, including NodeJS, things didn't stop there. So after sitting a few nights and mornings, I got to refactor  the code  (and put things in order with Javascript Promises and Design Patterns) and write a semingly decent way to add multiple translations to the game, aswell as turning much of it's functionalities into their own plugins (including a simple language selector menu).

As a means to kick things off, I've translated the game back to my mother language (Portuguese) and kept the English as it's somewhat internet's lingua franca.

Expect more dialogues in the following weeks to clear up what the hell is going on storywise, as the text mechanic was turned into its own plugin in this update (but keep in mind that this first iteration was Mcechinatto's and mine first attempt at game design and making. Coding wise it was somewhat of a 2-and-a-half-day nightmare).


As this didn't receive a proper devlog before, I'll link to the scaffold that helped us get up and running first (SPOILER: we had to do MASSIVE changes on it for the needs of our game idea, but still helps to have something solid to grasp at first hand):

https://github.com/B3L7/phaser3-tilemap-pack

Also, this wonderful tutorial for turning buttons into their own plugins helped at the language menu selector part of this update:
https://snowbillr.github.io/blog//2018-07-03-buttons-in-phaser-3/


That's all for now. If I forgot something, I'll edit this later.

Thanks for reading!

Hasta luego, people.

Leave a comment

Log in with itch.io to leave a comment.