CROQUET, HELP WITH KEYBOARD NAVIGATION

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

CROQUET, HELP WITH KEYBOARD NAVIGATION

Kweku Danso
Hi,
      I'm in Ghana and just started developing in croquet. I was
wandering if you could help me    with navigation. i want to use the
keyboard (WSAD) to move my avatar. i saw an example in KAT and tried
to go through the source code but no success.
     Really need help.

                    Thanks,

                    Kweku D.
Reply | Threaded
Open this post in threaded view
|

Re: CROQUET, HELP WITH KEYBOARD NAVIGATION

Darius Clarke
Hi Kweku,

Welcome!

Could you describe a little of what you've done so far?

Do you have some goals for exploring developing in Croquet you would like to share so we can give you some additional ideas to help you along the way?

You can have a look at the keyStroke: method in the KAvatarUser class to begin you exploration.

keyStroke: evt
    | char code |
    char := evt keyCharacter.
    code := evt keyValue.
    char = $w ifTrue: [^self startForward].
    char = $s ifTrue: [^self startBack].
    char = $q ifTrue: [^self startRotateLeft].
    char = $e ifTrue: [^self startRotateRight].
    char = $a ifTrue: [^self left].
    char = $d ifTrue: [^self right].
    code = 28 ifTrue: [^self left].
    code = 29 ifTrue: [^self right].
    code = 30 ifTrue: [^self up].
    code = 31 ifTrue: [^self down].
    ^super keyStroke: evt

Cheers,
Darius


On Tue, Jul 15, 2008 at 8:05 PM, Kweku Danso <[hidden email]> wrote:
Hi,
     I'm in Ghana and just started developing in croquet. I was
wandering if you could help me    with navigation. i want to use the
keyboard (WSAD) to move my avatar. i saw an example in KAT and tried
to go through the source code but no success.
    Really need help.

                   Thanks,

                   Kweku D.