In this past week of development I continued working on the item generator I started last week. This involved a lot of things and consumed my entire week. The first thing I had to work on is the grid which shows which items the player owns.
This was donw using 16 buttons which are arranged using the layout tools in Unity. As you can see this also includes multiple pages which can be flicked through at the bottom of the screen. The way this works is that while all the items are in one long list, only 16 of those items are shown at a time by being transferred to an array.
Each item is also generated randomly with a certain range in stats. This includes things like damage, defence, elemental type (if there is one), and of course which type of item it is (sword, bow etc.). There are also four different rarities for the items, ranging from the standard normal to legendary (with different names however).
The bow I got here is of "Shiny!" rarity, which is the rarest, and only has a 1% chance of dropping, so that's pretty lucky.
Next to this inventory stuf I also worked on mobile integration of the game. This meant adding touch support for the dragging of the camera, and also pinch zooming. These did not take nearly as long as he inventory as Unity makes it quite simple. I did learn a lot about the possibilities on mobile though; touch devices can check for a lot of information regarding the touch of the player.
Next week I should be adding the training of different units from different buildings, which includes drag and dropping units.