Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #37801

Re: Game loop losing fast key presses

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.javascript
Subject Re: Game loop losing fast key presses
Date 2019-11-16 21:21 +0000
Organization A noiseless patient Spider
Message-ID <87pnhrikks.fsf@bsb.me.uk> (permalink)
References <d1816a5d-ec3c-4f41-ac3a-c4cd96c8f788@googlegroups.com> <g9ru1qe6qi7j.bpid4srhpodm.dlg@40tude.net> <8675e9ad-cdfa-4490-9236-c733637de017@googlegroups.com>

Show all headers | View raw


luserdroog <luser.droog@gmail.com> writes:
<cut>
> That's interesting. I think I can make that work. So the fact of the
> keypress propagates through a few layers until the inner game loop can 
> handle it.
>
> If I make it an integer then the keydown can increment it and the game
> sets it to zero. That way the game can respond to multiple taps when it
> gets around to it.

Surely you have more than one key that matters?  If so, you can't just
count the presses because the order will most likely matter.  You need a
small queue of key actions that gets processed when the app can get
round to it.

(Jumping in here, so I may have missed the point.)

-- 
Ben.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Game loop losing fast key presses luserdroog <luser.droog@gmail.com> - 2019-11-15 10:22 -0800
  Re: Game loop losing fast key presses "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-11-15 11:03 -0800
    Re: Game loop losing fast key presses luserdroog <luser.droog@gmail.com> - 2019-11-15 21:05 -0800
  Re: Game loop losing fast key presses JJ <jj4public@vfemail.net> - 2019-11-16 12:07 +0700
    Re: Game loop losing fast key presses luserdroog <luser.droog@gmail.com> - 2019-11-16 12:27 -0800
      Re: Game loop losing fast key presses Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-11-16 21:21 +0000

csiph-web