02-20-2004, 08:47 AM
Nothing special, but it is just a small key multiple-key handler for the pure-QB people. It isn't commented, so if you are wondering, "Rls" means "release". For example, "jRlsCode" is the release code for j. I remember making one a long time ago, but I mde this one more refined. If it needs any more explaining, just ask.
Code:
'If you use it (yeah right), please give
'credit to PlayGGY
DEFINT A-Z
SCREEN 7, 0, 1, 0
CLS
CONST rlsCode = 128
CONST jKey = 0
CONST lKey = 1
CONST iKey = 2
CONST kKey = 3
CONST jKeyCode = 36
CONST lKeyCode = 38
CONST iKeyCode = 23
CONST kKeyCode = 37
CONST jRlsCode = jKeyCode + rlsCode
CONST lRlsCode = lKeyCode + rlsCode
CONST iRlsCode = iKeyCode + rlsCode
CONST kRlsCode = kKeyCode + rlsCode
CONST pressed = 1
CONST notPressed = 0
DIM gameKey(3) AS INTEGER
DIM x AS INTEGER
DIM y AS INTEGER
DO
SELECT CASE INP(96)
CASE jKeyCode
gameKey(jKey) = pressed
CASE lKeyCode
gameKey(lKey) = pressed
CASE iKeyCode
gameKey(iKey) = pressed
CASE kKeyCode
gameKey(kKey) = pressed
CASE jRlsCode
gameKey(jKey) = notPressed
CASE lRlsCode
gameKey(lKey) = notPressed
CASE iRlsCode
gameKey(iKey) = notPressed
CASE kRlsCode
gameKey(kKey) = notPressed
END SELECT
IF gameKey(jKey) = pressed THEN
x = x - 1
END IF
IF gameKey(lKey) = pressed THEN
x = x + 1
END IF
IF gameKey(iKey) = pressed THEN
y = y - 1
END IF
IF gameKey(kKey) = pressed THEN
y = y + 1
END IF
PSET (x, y), 1
PCOPY 1, 0
LOOP