Energy Regeneration
Posted: Sat Jan 04, 2020 3:57 pm
Hey guys, I'm trying to figure out the best way to handle how energy restores for my game. At first I was just going to run a cron every 10 minutes adding 10 energy points to all users. However, that didn't seem right because certain users perform energy depleting actions at different times, and I would want the regeneration to be 10 minutes from their last action. With that said, how would you handle this?
Add 10 to a user's energy 10 minutes after they performed their last action.
Only thing I can think of is starting to use timestamps in the user tables. By the way I am using PHP/MySQL.
Add 10 to a user's energy 10 minutes after they performed their last action.
Only thing I can think of is starting to use timestamps in the user tables. By the way I am using PHP/MySQL.