Hi guys, I am trying to find the way to create a system like a most casual game used but need help. I have 20 Energy points and need to consume 5 when you push play and regenerate this energy point when past some time…
if you reach 0 the player needs to wait or see a video or buy more energy.
Does Anyone have a tutorial or can help me with that?
You can create simple save data that stores the current energy value and the last time it changed. Each time the value changes, you’ll want to resave, whether from spending it or gaining it through videos, purchases, etc. By saving it, if the app is closed and the player comes back later, you can check how much time has passed and the previous value to recharge their energy on startup.