Game dev, Suit’em up – Customization menu and textile (pickups) manager

We are preparing for a play testing with friends and family. Some things need to be added before that and one of them is the customization menu.

I have worked hard on revising the menu. To explain what it does: In our game there are four different textile pickups that are scattered throughout the world. These can be equipped into four slots in the customization menu.

Previously, the menu looked like this:

Screenshot 2014-02-27 19.52.57

In this old menu, you had to press one of the four slots FIRST (they are the buttons connected to yellow lines). After selecting one (without getting any graphical feedback) you needed to press one of the textiles, the buttons to the right, to place them in the selected slot.

Everyone who has play-tested and all members of our development team thought that it should be the other way around, that you should press the textile FIRST and then the slot.

The old code was messy. Here are two pictures of it:

customize_old1

customize_old2

If you study the code a bit, you will probably see that it is very inefficient. There are possibilities for loops all over the place.

Also, our TextileManager had a lot of crappy getters and getters (get-/set-methods). It looked like this previously:

get_set_old

Enough about what was wrong with it. I did a lot to improve it!

I started with polishing up the TextileManager and even added another count, the equipped textiles count. I created an enum for the different types of textiles and the code looks like this now:

textile_enum

get_set_new

So clean!

I then started with the customization menu state. The first thing I did was removing all the old code since it was poorly written. By me I might add. This time I added support for looping the buttons and I did so every chance I got. I’m really happy with the result.

The code is now efficient and it does it’s job even better than the old one. It is now easy to read and edit as well.

Here are a couple of pictures the new code:

customize_new1

customize_new2

It’s so shiny!

The customize menu state previously had 480 lines of code and now it has 349 lines.

The TextileManager previously had 243 lines of code and now it has 193 lines.

Here are a couple of pictures of the new menu:

Screenshot 2014-02-27 20.17.47

Screenshot 2014-02-27 20.17.51

Screenshot 2014-02-27 20.17.53

If you noticed from the second picture, there is now a glow on some buttons. This glow happens when selecting a textile, for visual feedback. We will probably change the sprites some time in the near future, but I believe that these will work well as placeholders.

The bonus text isn’t there right now, but it will be added shortly.

Another thing I changed is that we are now using a spritesheet instead of 8 different sprites. The spritesheet looks like this:

textiles

That is in short what I did these past six hours. I’m happy with the amount of time it took and the result as well.

A couple of more things need to be added tomorrow before the game is ready for “friends and family”-playtesting.