osso73 / classic_games

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

Change size of snake to use scale-independent pixels #50

Closed osso73 closed 3 years ago

osso73 commented 3 years ago

Now the size of snake (and the food, and the grid) is defined as one 10th of the smaller screen size (width or height). Now using metrics this could be changed using scale-independent pixels.

I'm not sure this makes sense, need to try it.

An alternative is to set the size of grid via menu: instead of one 10th, it could be one nth, where n can be chosen by the menu button to be several pre-defined values (such as 10, 15, 20, etc.)

osso73 commented 3 years ago

Implemented a menu of change size, cylcing to a set of pre-defined sizes: 5, 10, 15, 20, 25, 30. This size is the number of grid positions that GameBoard has in the shortest side of the window. This will define the size of the snake: the higher the number, the smaller the size.