Hello, I'm having an issue sorting out the logic with making a power-up for my game. Basically, when the player collects the power-up, a bar is filled that slowly empties. What I want to have happen is, while the bar is not empty (i.e. has a width greater than zero), the player has 1 point added to one of their stats. I'd like to do it this way so that the bonus does not stack if they collect the same power-up multiple times, therefore it only applies once while true.
This seems like it would be pretty simple but it's turning out to be kind of hard to wrap my head around, namely because I don't know how to do truly temporary additions to variables- as in, not using two different events to add the bonus stat point and then subtract it again when the bonus runs out. If that's the only reasonable way, feel free to let me know how to do that, but I'd like if there were a more elegant solution that only took one event.