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.
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 calladd_value
if the grid has changed.