Cursor Key Problems

Blitz3D Forums/Blitz3D Programming/Cursor Key Problems

Ditto, but with the key codes referenced as variables (so you can easily let the player redefine 'em)

Graphics 640,480,0,2
SetBuffer BackBuffer()

KLEFT=203
KRIGHT=205
KUP=200
KDOWN=208

px=160
py=120

While Not KeyDown(1)

Text px,py,"O"

If KeyDown(KLEFT) Then px=px-1
If KeyDown(KRIGHT) Then px=px+1
If KeyDown(KUP) Then py=py-1
If KeyDown(KDOWN) Then py=py+1
Flip True
Cls
Wend


I see you went for the lower case "o" there Pert; I, myself, prefer the capitalised variant. Look, I wrote a ruddy example and I'm posting it! :D