My user interface is the most intricate, convulsed and essential part of my entire project. My user interface class is the core class which branches to other classes in order to seamlessly like the user input with all the features of my game.
Game Icons
I have created four user icons which are drawn onto the in game camera which allows the user to navigate through my game.
Store Icons
Figure 1a Figure 1b
I chose to use a shopping cart on my store icon as a shopping cart is synonymous with a store. I hoped that users would see the icon and instantly recognise that is they pressed this icon they would be transported to the store section of my game where they could buy new objects and change the appearance of the restaurant. The two icons are 64 pixels by 64 pixels reiterating the sentiments I explained in my opening introduction that all my textures will be a multiple of 16 pixels in order to aid in scalable textures.
You'll notice there are two textures that serve the same function. In order to feed back to the user that they are able to click on the icon I have created another texture, figure 1b, to act as a 'mouse over' texture. I achieve the effect by adding rectangular collision box around the icon and then checking whether the cursors position is within the rectangle. If the cursor is within the dimensions of the icons rectangle I swap the textures around to give instant recognition to the user this icon is a button which can be interacted with.
In my user interface I have used a enum variable, this is a made up variable which allows the coder to create multiple properties the variable can use, to separate my code into different game states. If the game is in a certain state it will only execute the code I have determined to be executed. If the store icon is pressed the game state is set to store which executes store only code and stops executing the code from the previous state.
Options Icons
Figure 2a Figure 2b
I struggled with what to come up with for the options icon initially. The obvious choice would be to do a cog as that is the symbol most games use and therefore it's become synonymous with the game options however I didn't just want to plain copy other games. The icon I have used is three sliders which I hope people will recognise from options screens where you change sound, music etc... using sliders usually with zero being at the bottom and one hundred percent at the top.
The icons act in the exact same way as the previous icons except that once the button is pressed it will take you to the options screen. I failed to mention above that the store page is a full screen page however when the options screen is initiated it will only take up about half the screen in the centre. I wanted to show the user that the restaurant is still running in the background whilst they are perusing the game options.
Staff Icons
Figure 3a Figure 3b
My initial thought when creating an icon to represent the staff screen was to have multiple humanoid looking people on it however as the game is generally cartoony in appearance I didn't want to go the realistic approach therefore I came up with the textures in figure 3. My hope was that when people view the icon they would see the three humanoid looking and assume it would have something to do with people. I hope people would make the leap that it's the icon used to navigate to the staff section of my game where you manage the restaurants employees.
Exit Icons
Figure 4a Figure 4b
The last game icons are the exit button icons which are used across multiple game states to instantly navigate back to the default in game scene. As the button is used to leave alternative game states this button is not added to the in game scene with the other three icons as it would serve no purpose. The icons design comes directly from the icon used on all major operating systems to close down an application therefore I hoped used would know that clicking this icon would instantly close down any sub screen they are on and navigate directly back to the default in game screen.
Restaurant Open/Closed
Figure 5a Figure 5b
In order for my game to work without errors I really need to prevent the users removing/adding game objects whilst the restaurant is open as the AI will be affected by the changes. To aid with this I have added a restaurant open/close boolean which prevents the staff and store icons being pressed while the restaurant is open.
For example if a staff member was in the middle of fulfilling an order and then the user wanted to fire that staff member the order would be left unfulfilled, the customer forever waiting for the order to be completed and no other waiters could fulfil it as my game code would say it's already being handled.
With the restaurant open state the user would have to close the restaurant to nullify all orders, remove all staff and remove all customers. The user would then be able to add or remove staff which will then be reflected when the staff are loaded back in when the restaurant is opened again.
The signs act much like the icon buttons as they have a rectangular collision box attached and if the cursor is within the collision rectangle the sign will switch to the alternate texture and a boolean containing the true/false value of the restaurants open status will switch too.
Appearance
Here is how the default in game screen will look like...
Figure 6











No comments:
Post a Comment