Jumping Jack Flash
Richmond
richmondmathewson at gmail.com
Sat Jul 4 11:14:30 EDT 2015
On 04/07/15 18:11, Richmond wrote:
> On 04/07/15 15:10, Paul Dupuis wrote:
>> On 7/4/2015 4:47 AM, Richmond wrote:
>>> One of the children on my Summer course was having 'problems' with
>>> animating a 'person'
>>> to jump [ think "Super Mario"].
>>>
>>> Well, I don't know what he is doing this weekend, but it took me all
>>> of 15 minutes to knock together a basic walker-cum-jumper:
>>>
>>> https://www.dropbox.com/sh/tyt4o1md51bfair/AABThCCgJkqLQvz1e-NRQGg7a?dl=0
>>>
>>> File: Walker.zip
>>>
>>> HOWEVER, there is a slight snag insofar as that having been bashing
>>> the left arrowKey, when I bash the up arrowKey (to generate a jump),
>>> the character jumps, but then continues to execute the code stored
>>> from my pressing the left or right key for far too long than is
>>> necessary.
>>>
>>> The same thing happens if I press the left key repeatedly, then the
>>> right key once.
>>>
>>> SO, what I need is some sort of INTERRUPT code so that when I press a
>>> new arrowKey all previous information fed by my key bashing gets lost.
>> flush the pendingMessages of the queued arrowKey messages you no longer
>> want (see 'the pendingMessages' and 'cancel' entries in the dictionary)
>>
>>
>>
>
> Well, I tried flushEvents("all"), flushEvents("keyDown"),
> flushEvents("autoKey")
> to no effect . . .
>
> Mind you, I am not sure if I can understand what the dictionary says
> about flushEvents,
> or maybe the fact is that the entry really isn't comprehensive.
>
> Richmond.
Here I go again - replying to my own posting.
I think that what I really need is a way to stop the arrowKeys from
auto-repeating [ hmm; what's flushEvents("autoKey") for? ].
Richmond.
More information about the use-livecode
mailing list