2048.wasm
2048.wasm copied to clipboard
New tiles should not appear if no changes occur
Nice project, love the game! Going off of other versions of 2048 that I've played (e.g. 2048.io), if an attempted move doesn't slide any tiles then no new tile should spawn. This makes the game a bit more challenging, forcing the player to move tiles each turn.
Looks like the easy fix would be to copy the grid in loop before a key event tries to modify it, then only call add_value if the grid has changed.
@tcsullivan Good catch.
Feel free to take this up if you are still interested and find time - or else I will some time in the future.
Thanks!