Hi,
How do I add hitpoints (or any variable for that matter) to a specific tile in my game?
Currently, I have tiles of mushrooms, trees, ore, etc..., and I have a mechanic where the player destroys it in one hit if the distance and tool in hand requirements are met. However, I want to deepen then experience by adding hitpoints to the specific tile being "attacked".
I know how to do this easily with sprite instances but having a bunch of sprites kind of defeats the purpose of the tilemap and it also slows my game down a lot. (tested it previously)
Any ideas on how to do this or is there another way? I need a hitpoint variable associated with each tile so that the attack can be done and "chip" or "chop" away at the tile, reducing its hitpoints until zero. Right now it's one hit, one achievement and then I automatically switch the specific tile to grass or whatever the natural environment is.
For example, if the tile being attacked is 34 and 34 has been coded to be a "tree", then the maximum hitpoints are 10 but I also need to know which tile it is specifically not just in the tilemap object itself but in the instance . If the tile being attacked is 73 and has been coded to be a "copper ore", then the maximum hitpoints are 6, etc...
One thing I thought of and it is not ideal is to just identify which tile index id the tile being attacked is and then make the player roll a dice roll higher than a specific requirement, with the aid of the tool and player strength as +N for the dice roll, however, that would really change my vision of how to achieve things in the game.
Thanks for any help. I think I am really close to being able to run with my vision. Everyone has been great these last few weeks.