Snake in Elm with WebGL
github.com
Snake in Elm with WebGL
1–10 of 29 posts
Re: Snake in Elm with WebGL
#2Re: Snake in Elm with WebGL
#3How is the actual game loop executed? I don't know Elm but I only find update, not how it's run.
http://package.elm-lang.org/packages/elm-lang/html/latest/Ht...
Re: Snake in Elm with WebGL
#4Similar bug with RIGHT->DOWN->LEFT
And so on for all the other initial directions.
Re: Snake in Elm with WebGL
#5Re: Snake in Elm with WebGL
#6I attended a two day Elm workshop a while back. There is a lot there to love, I just think it's Haskell inspired syntax is a major impediment to it's mainstream adoption. I however would love to be proven wrong as the webs reliability would be so remarkably improved.
Re: Snake in Elm with WebGL
#7I attended a two day Elm workshop a while back. There is a lot there to love, I just think it's Haskell inspired syntax is a major impediment to it's mainstream adoption. I however would love to be proven wrong as the webs reliability would be so remarkably improved.
Re: Snake in Elm with WebGL
#8Bug: Create snake of length two. Move RIGHT. Quickly press UP LEFT in quick succession. Lose. Similar bug with RIGHT->DOWN->LEFT And so on for all the other initial directions.
Re: Snake in Elm with WebGL
#9Bug: Create snake of length two. Move RIGHT. Quickly press UP LEFT in quick succession. Lose. Similar bug with RIGHT->DOWN->LEFT And so on for all the other initial directions.
(1) - You can only change directions that will change your axis, if you're going left your possible changes are up and down, ....
(2) - You should be only able to consume one direction change per game tick, what is happening here is that rule (1) is working but you can change into the other axis, and then back to the other axis again before the game loop computes another frame. Direction change can be read asynchronously but the actual change should be tied by each tick.