REBOL.net

realtime game controls

Anohin Vladimir (anohin.va)
23-Sep-2007/4:46:41-4:00
#43057
<Back   Thread   Next>
<Back   Index   Next>

Dear friends,

please show me a way to make better controls for simple game. Now I
have a code like that:

vis/feel: make vis/feel [
   detect: func [face event][
      if event/type = 'key [
         switch event/key [
            left  [ x: x - 2 ]
            right [ x: x + 2 ]
            up    [ y: y - 2 ]
            down  [ y: y + 2 ]
            #"q"   [ quit]
         ]
      ]
    face/effect: make-draw blk x y
    show face
    event
   ]
]

But controlled face is moving jerky and control keys are "sticky", so
when a control is pressed and then is unpressed, face is still moving.
Is there a way to do real-time controls?

Rebol's truly,
Bakava.


<Back   Thread   Next>
<Back   Index   Next>

REBOL.com