CROQUET, HELP WITH KEYBOARD NAVIGATION

View: New views
2 Messages — Rating Filter:   Alert me  

CROQUET, HELP WITH KEYBOARD NAVIGATION

by Kweku Danso :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

Re: CROQUET, HELP WITH KEYBOARD NAVIGATION

by Darius Clarke :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <kweku.danso@...> 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.