Upon creating a binding to one of the graphics in the inventory I begun creating the logic. Before I went about doing this though, I created four variables of type Slate Brush; CurrentImageG, CurrentImageB, CurrentImageT and CurrentImageL. The purpose of these variables is to hold the brush values. In the beginning of the function I want to do a check. If CurrentQuantityG is equal to zero then set CurrentImageG to the graphic that indicates to the player that we are out of this item. If false have the default image be the image assigned. Afterwards we want to return CurrentImageG. Having this function binded to the brush allows us to dynamically change the inventory graphic depending on what quantity is.
Now that we have this function done I begun duplicating the logic onto the other functions I binded to the graphics. Thus completing the HUD for Max Proof! The great thing about having our logic like this for the HUD and as well as creating a dynamic item class is upon creating other levels for Max Proof, all we have to do is throw hazards of Item into the scenery and everything will work perfectly. Having achieve this we were able to minimize the amount of additional logic we would have to create when beginning a new level. With that being said, onto the next task!
No comments:
Post a Comment