osso73 / classic_games

A series of classic games in Kivy
MIT License
3 stars 1 forks source link

In 2048, only lose game if no moves possible #19

Closed osso73 closed 3 years ago

osso73 commented 3 years ago

Now if all tiles are full, the game is automatically lost. Change that to check if there is a possible move to be made (e.g. 2 contiguous tiles with the same value), in that case it is not lost as a move can be made. Game should be lost only when no moves can be made, and all tiles are full.

osso73 commented 3 years ago

Done. Added a function to check if any moves are possible. If not possible, then the game is finished. If there are empty tiles, the function returns True (e.g. there are moves possible).