Quantcast
Channel: Questions in topic: "tree"
Viewing all articles
Browse latest Browse all 513

Best way to do a tree growth/drop system?

$
0
0
HI everyone! I'm developing a mobile game where you can tap on trees to get a fruit drop or use an axe to chop them and get some wood. If you chop a tree, it then starts growing again. Every tree has to store it's own time variables like "lastTimeDrop" and "timeLeftToGrow" so I can check if the tree has grown or if it can give the player another drop. My problem is that I don't know which is the best aproach to handle all the trees. Should I have an array with all my trees and other arrays with their varaibles and check them all every second? Is better to have every tree with a script (same script for all of them) ? Any help will be apreciated! Also, how can I track every tree between game sessions to know which tree has grown, which tree can drop something, etc.? Thank you very much for your time, Sergio

Viewing all articles
Browse latest Browse all 513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>