okay...a toggle it is, then.
but the code you have won't do anything other than set bTurret to 2 once 'g' is pressed once, and then nothing. it will always be 2.
here's what i think you wanted to do. you need an external variable to store whether or not the 'g' has been pressed already or not, and only do the switch once the key has been let go:
bTurret = 0
TurretToggle = 0
sync on
do
cls
set cursor 0,0
if inkey$()="g"
if TurretToggle < 1
if bTurret = 1 then bTurret = 0 else bTurret = 1
TurretToggle = 1
endif
else
TurretToggle = 0
endif
print bTurret
sync
loop
of course, the core of the snippet that you need is this:
if inkey$()="g"
if TurretToggle < 1
if bTurret = 1 then bTurret = 0 else bTurret = 1
TurretToggle = 1
endif
else
TurretToggle = 0
endif
btw, using
and inkey$()="g" inside the outer
if statement is never needed. you wouldn't have made it into the inner statements if it weren't true in the first place.
hope this helps.
cheers
-= i only do what my rice krispies tell me to do =-