Game Development Community

Mining system

by Adam Troutman · in Game Design and Creative Issues · 04/26/2006 (2:51 pm) · 5 replies

I want to work on a mining system, I was thinking just a good old pickaxe weapon that you could hit rocks with and once they take a certain amount of damage they would be destroyed and drop an ore on the ground whcih you could then pick up and use for other processes, I just don't know how to go about this. how can I make a rock object take damage from a certain weapon but not others and I would need it to respawn after a certain amount of time. any suggestions would help thanks.

#1
04/26/2006 (2:55 pm)
You could put a check when your rock takes damage to see what weapon is damaging it
#2
04/26/2006 (3:45 pm)
And when the rock is broken you could spawn some ores around it that player could pick up.
#3
04/26/2006 (7:06 pm)
The ::damage function by default already has a parameter for %damageType to be passed through. Make your pick-axe weapon do "Mining" type damage or something, check this in your rocks ::damage function, and then when it's damaged enough, instead of deleting it, call setHidden(true) on it, and schedule it to repair itself and unhide after a certain amount of time. If you need more specifics I can give you a code example.
#4
04/26/2006 (7:13 pm)
That would help a lot, maybe I just dont understand things well enough to do this.
#5
08/11/2006 (11:04 pm)
When your done, write it up as a resource! :)