You did change the behavior, though. Specifically, AnimationFrame.ticks is
always running in your version, even when the game is paused. Similarly for
some of the other subscriptions. As discussed in the generic subscription
filtering thread, it's best to turn off subscriptions completely whenever
possible. Of course, you could adapt your version of the
subscriptions-function to bring the turning-off-of-subscriptions back.
However, the result will be again more complex and less readable, I think.
You will have the dealing with subscriptions distributed over different
places in the code, while the original version and also the version
improved by selective Keyboard functions has only one.

Am Donnerstag, 11. August 2016 schrieb OvermindDL1 :

> Yeah they would be useful.  I went ahead and tried my hand at editing the
> code a bit to make it what I think is more readable, although the entire
> project gets formatted exceedingly differently if elm-format is run over
> it, so I did not and followed the existing style.  I'd not messed with a
> game in Elm yet, that was fun.  :-)
>
> But yeah, just a little keypress state action mapper, nothing special,
> easy to read but a bit longer (could put most of it 'in' subscriptions
> instead of another function like I did, but eh, I also like explicit events
> to change states so PauseToggle was broken up from 3 purposes to 3 distinct
> events, multi-purpose events bug me... this did make the program longer
> though, but more readable and easier to follow in my opinion):
> https://github.com/OvermindDL1/dontfall
>
>
> On Wednesday, August 10, 2016 at 3:42:46 PM UTC-6, Gábor Varga wrote:
>>
>> I like the proposed changes to keyboard API, they would definitely make
>> my life easier.
>>
>> Also, that is the level where I want to do filtering in this case: as
>> close to the event source as possible. Since the idea is that I am not
>> interested in a bunch of events: I do not want them to be sent to my
>> application at the first place.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com
> <javascript:_e(%7B%7D,'cvml','elm-discuss%2bunsubscr...@googlegroups.com');>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to