JordyMoos / elm-pixel-boulder-game

Pixel Boulder Game in Elm
https://jordymoos.github.io/elm-pixel-boulder-game/?startLevel=official%2F001&hideDebug=1
MIT License
41 stars 6 forks source link

Optimize view creation #151

Closed JordyMoos closed 5 years ago

JordyMoos commented 5 years ago

Its a bit tricky.

If the game speed is super fast. Then the game state will not be updated. But the model will (to keep track of passed time) This cause the view to be recalculated while nothing changed.

Better would be to create the view after the update loop (only if there where game ticks) But on the other hand. What if more update messages come without actually a new view. Then we recreated it for nothing.

Not sure if this can happen in elm Therefor I suggest the easy approach to create the view after all update ticks

JordyMoos commented 5 years ago

Done