2048.wasm icon indicating copy to clipboard operation
2048.wasm copied to clipboard

New tiles should not appear if no changes occur

Open tcsullivan opened this issue 4 years ago • 1 comments

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 avatar Mar 04 '21 13:03 tcsullivan

@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!

inishchith avatar Jun 14 '21 05:06 inishchith