Retro Lord Posted January 11, 2015 Share 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 Link to comment Share on other sites More sharing options...
+Random Terrain Posted January 11, 2015 Share 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 Link to comment Share on other sites More sharing options...
Retro Lord Posted January 11, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.