problem with stacking "KeyHits"

Blitz3D Forums/Blitz3D Beginners Area/problem with stacking "KeyHits"

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

That's normal.

What you have to do is set the returned value from KeyHit(28) to a variable and then test the variable.

Like so:
KH28 = KeyHit(28)
If selectpos = 1 And KH28 ; For game start
  Goto gamestart
EndIf

If selectpos = 3 And KH28 ; For options
  Goto options
EndIf
or a little more optimized:
KH28 = KeyHit(28)
If KH28
  If selectpos = 1 ; For game start
    Goto gamestart
  EndIf

  If selectpos = 3 ; For options
    Goto options
  EndIf
EndIf
(A little note: The KeyHit command actually returns the NUMBER of keyhits since the last time it was checked. So, in my example above, KH28 could actually contain a value higher than 1 depending on how often you check it's returned value.)