ocamllabs / 2048-tutorial

OCaml tutorial based on the 2048 game
49 stars 12 forks source link

Animate ! #16

Closed dbuenzli closed 10 years ago

dbuenzli commented 10 years ago

The result can be seen here. Don't forget to reload the page.

The animation is quite smooth in chrome but it seems that in FF and Safari it is a little bit choppy. Maybe the code is too functional (there are no assignment and/or mutation at all in code of the whole game) for JavaScript's engines.

dbuenzli commented 10 years ago

Btw. didn't include scoring because that would complicate rendering a bit (non-square rendering surface + layout, as doing with a div, would entail we'd need to use the js_of_ocaml syntax extension which we don't use at all). If you really want it I can put it, but I think that since this is for education it's better to keep things simple. (Same can be said with game over/restart game which is not really polished).

dbuenzli commented 10 years ago

Oh and since I'm a very bad gamer I never managed to finish the game, but I saw the "You win!" overlay in my cheat mode.

lpw25 commented 10 years ago

This looks excellent now. It looks absolutely fine for me on Firefox.

The game logic also now seems to be almost completely correct: the only thing slightly off is the odds of a 4 square showing up, which should be 1/10.

yallop commented 10 years ago

It looks very nice indeed!

Ok to merge?

dbuenzli commented 10 years ago

Yes !