rem ************************
rem My various bit variables
rem ************************
dim Bit0_Debounce_Reset = var47
dim Bit1_Debounce_Fire = var47
dim Bit2_Game_Mode = var47
dim Master_Counter = var46
dim Frame_Counter = var45
goto titleScreen
rem ************************
rem Hard Reset. Takes user back
rem to the title screen and clears out
rem all the variables as well.
rem ************************
Hard_Reset
pfclear
drawscreen
for temp5 = 0 to 25 : a[temp5] = 0 : next
for temp5 = 0 to 46 : var0[temp5] = 0 : next
Bit0_Debounce_Reset{0} = 1
titleScreen
gosub titledrawscreen bank7
if !switchreset && !joy0fire then Bit0_Debounce_Reset{0} = 0 : goto titleScreen
if Bit0_Debounce_Reset{0} then goto titleScreen
goto GameSetup
I'm trying to wrap my head around using bits for booleans to control various aspects of game I'm working on, and I'm missing something. Can someone explain to me exactly how the above code works so I can use it in other places!
Essential what I want to do in my code is make sure that the fire button won't tigger an action until it has been release, but for whatever reason, I can't seem to wrap my head around this bit codes to act as booleans and check it.
Thanks
Edited by disjaukifa, Thu Sep 29, 2011 11:09 AM.














