thoughtram / reactive-snake

Taming snakes with reactive streams
83 stars 27 forks source link

Fixing initial opposite direction #1

Closed semiversus closed 6 years ago

semiversus commented 7 years ago

When the game is starting the detection of opposite directions is not working, because .startWith(INITIAL_DIRECTION) is after .scan(nextDirection), so nextDirection is not called on first keydown.

0x-r4bbit commented 7 years ago

Thanks @semiversus ! @d3lm mind reviewing this one?

semiversus commented 7 years ago

Great article by the way. Helped me a lot. Working through your article I found a wrong link:

Nonetheless, you can find the source code for this on GitHub.

The link is pointing to d3lm's reactive-snake repository which is removed in the meantime.

0x-r4bbit commented 6 years ago

Merging on behalf of @d3lm

Thanks @semiversus !