In the last part
of this project I implemented the mining and animations and it was now time to
move onto the damaging of the ores. To implement this system, I used a similar
system that I used in Unit 603, which was a override method. All ore blocks
inherit from an empty script called HealthManager.
This allows me to set individual stats up within an ore’s script, and then
these values can override the method within the HealthManager script.
The challenge
with this part was figuring out the best way to apply damage, and this was the
best way that I could see fit. I also implemented the state system, and each
state represents 20% of the ore’s health. At each state I set the sprite to
change to a cracked or even more cracked version of the current sprite. My
reason for using states is that it allows me to add events further down the
road, such as explosions from the ore, or gems / valuable items dropping /
being found. If I choose to implement this, it will come after the core
elements of gameplay have been implemented.
Speaking of core
elements of gameplay, this leads me onto the next development that I will be
working on; the inventory system. At this current state of the game, the player
can mine the ore, but it’s only being destroyed. This means that I need an
inventory system so that the ores can be stored, to later be sold to the shop.
My next post will demonstrate how I’ve come to implement the inventory system.
No comments:
Post a Comment