I try to write a simple game.In my game i have businessmen .These businessmen have money but i want to change some of them's money randomly for a limited time.Like in the snake game.does anyone know how to???
Lets say a businessman has 200, then you give him 300 more so he has 500 and after a minute he'd have 200 again? And what if he spends 50 during that minute? Does he then still have 200 after, or is there only 150 ?
So how about you have a timer t and flag f. When you give a bonus, set f and set t to 1 min (and add 300 to the money). In the main loop, if f is set and t has expired, f = false and subtract 300.