Energy system for social games
Energy is a consumable and recoverable stuff in social games. It limits how far players can advance in each session.
Players use energy to do actions like farming, housing, or social actions. Then consumed energy will be recovered after few minutes. Recovery is the essence of energy system. It will make players to come back to the game periodically.
>>> energy = Energy(10, recovery_interval=300) >>> print energy <Energy 10/10> >>> energy.use() >>> print energy <Energy 9/10 recover in 05:00>