I need to implement the sleepiness status effect. This will cause you to doze off periodically, if you don't take a proper nap. What it falls to me now, to do, is implement some kind of appropriate visual analogue for being sleepy.
What I want is to have sort-of an "eyelid" over the whole screen. As you get sleepy, the eyelid should start to close, eventually blinking periodically until it closes completely and you get a "you fell asleep" message.
Not too hard, but what's the appropriate way to model the eyelid effect?
We could just use a sum of sine curves of different phases/rates, and use that to determine how open or closed it should be. We could use a bit of a function on top of this to make it tend to fully open or fully closed, or to a few levels of open-or-closedness. Or some kind of holdness counter, where we hold our eyelids for X seconds at the current sine level, then change them and reset the holdness counter.
Hmn, I thought this was going to be a long post about some kind of model for fighting to keep your eyes open, but I think this may just be simpler than I thought.
Hmn, this LJ post didn't go through the first time. Anyhow, sleepiness now works splendidly. Your eyelids droop and eventually you just nod off. You can also sleep in beds (much better). Voila!