Monday, April 21, 2014

Adding A Little GUI To The Mix

What can I say... sometimes you just have to work on what has you most inspired at the moment, and right now that's my prototype.  I've added some basic GUI elements, which will come in handy when this Orc starts harvesting the trees for lumber.  I've also got some buttons down in the corner, which will come in handy on touch devices.  Lastly, I've added some selection indicators for both the current selected object (circular) and that objects target (square).

My opinion may be biased, but this is really starting to look like a game to me

My goal is to program the Orc worker so that when he chops the tree, he gathers resources over time.  When he has chopped all he can carry, he will return it to the tower, and then go back for more.  Before I get this done I am going to convert the movement system to use Unity3D's NavMesh, rather than the temporary one I have in place.  This will allow the Orc to walk around obstacles to reach his destination, which will come in handy in the future.  I'd put this off, but I have a feeling if I programmed the resource collection system first I'd pay for it in the long wrong with a lot of re-written code.  Best to do things in order, at least when the opportunity presents itself.


Chop A Tree or Raze A Defense Tower!

Adding interactions went smoother than I had originally thought.  With some quick trigger collision detection and animation controller scripting, you can now right click and tree and the orc will begin chopping it when he arrives.  You can also click the tower and he will begin attacking it.  I will be modeling a hammer in the near future to replace the axe when this happens, so he will be building the tower rather than attacking it.
The Orc can now chop trees and attack the tower

Unfortunately the treasure chest asset does not open, or I would have added that interaction as well.  
My next step will be to begin work on tracking how much wood has been gathered, and removing the tree when it's resources are exhausted.  From there the orc will bring the resources to the blank area where the tower exists now and use the lumber to begin construction.

<< TAKE ME TO THE DEMO>>