Retro Lord #1 Posted January 11, 2015 I'm having some problems with getting a debounce routine working so that the player can't just hold down the fire button. What am I doing wrong? The f counters are used for animation. When the player presses the button I want the second frame of the animation to show and then revert too the first frame. drawscreen if joy0fire then f=20 else f=10 if f=20 then goto skip skip goto main Quote Share this post Link to post Share on other sites
+Random Terrain #2 Posted January 11, 2015 Have you looked at this yet:randomterrain.com/atari-2600-memories-batari-basic-commands.html#repetition_restrainer_for_fire_button Quote Share this post Link to post Share on other sites
Retro Lord #3 Posted January 11, 2015 (edited) Great example! Didn't know the routine was called repetition restrainer. I have another related question. How would I go about making the second animation frame last for about 1 second in this example? Not sure a f=f+1 counter would work? drawscreen if f=20 then f=10 if !joy0fire then _Bit1_FireB_Restrainer{1} = 0 : goto __Skip_Fire if _Bit1_FireB_Restrainer{1} then goto __Skip_Fire _Bit1_FireB_Restrainer{1} = 1 f=20 : score=score+1 __Skip_Fire goto main Edited January 11, 2015 by Retro Lord Quote Share this post Link to post Share on other sites