Pre Alpha Coding

This week I have been working mostly on finishing smaller programming tasks in order to get our first alpha build of the game up and running. I also created the base for our item selection system, where the player can select up to three items to take with him/her into the level.

Item selection system with placeholder graphics.

The item selection system lets you choose up to three items from the database of items at the top of the screen, each item has a unique ID that later will be used to give the player the corresponding item to use during the level. New items can dynamically be added and removed from the database. All the basic functionality of the selection system works as intended, click to add/remove item from the action bar, you can only have one of each item.
The only big problem I encountered while coding this system was due to my inexperience with Unity, the problem I encountered was that when you clicked on an item in the database it would add two of that item to the action bar. I first thought that there was something wrong with my code, but when I could not find anything wrong with the code I started searching around for how Unity handled input, it turned out that the default Unity function I was using, OnGUI (for drawing on the graphic user interface), is called several times each frame, this made it so that the mouse click was registered several times each frame making the program add several of the same item, In order to fix this problem I had to move the actual input logic to the normal Update function which is guaranteed to only be called once each frame and only handle the actual drawing of the interface in the OnGUI function.

Placeholder graphics for pre alpha.

My second bigger task was to add the placeholder models and animations to the player (blue) and guard (red) in the game. This task went relatively painlessly, thanks to the good tutorials at the Unity website I was able to implement the models and animations created by our fantastic artists with no problems.

Jonas Yzermans Falkheden