Home | Forums | What's new | Resources | |
Paddle management |
vbt - May 4, 2007 |
slinga | May 10, 2007 | ||||
I remember running into a similar problem in my Snakes clone. I handled pause like this:
Code:
|
vbt | May 13, 2007 | |||
Thanks Slinga and good to see you back |
RockinB | May 14, 2007 | |||||
To detect the push of a button, you'll have to detect the transition from not pressed to pressed. The SGL already keeps track of that information on it's own. The problem you might ran into (in a frame-by-frame approach) is that one button press of the user might result in a couple of pressed/not pressed states in successive frames. Might be a physical or mechanical issue of the pad's button. Anyways, to detect a push, you'll have to record the button state of the previous frame, at least. What I suggest to overcome the above mentioned problem is, to record the button state of multiple frames instead. For example after a push, when the button state is "released" in the last 3 frames, then you can be shure that this push is really over. |
vbt | May 15, 2007 | |||||
Nice I'll test this method also, it can be usefull in all my "bad" devs. I've just found also in the doc (I rarely check it * PER_GetEdge() Get the trigger information that changed between two specified timings. * PER_GetPressEdge() Get the trigger press information between two specified timings. * PER_GetReleaseEdge() Get the trigger release information between two specified timings. I have no idea if it's worth to use them or it can affect speed. |