Skip to content

Improving the Snake game #141

@CRImier

Description

@CRImier

We now have a rudimentary Snake game, contributed by @Gnu-Bricoleur (here's the code in devel). It's awesome, and the splash image never fails to put a smile on others' faces =) While reading the code and watching people play it, I've found some improvements that could be made, so I'm keeping track of those here - in case anyone's interested in helping.

  • The resolution of the game is very small, so the difficulty is high. Thus, it would make sense to increase the snake's dimensions, at least as an option for "Easy" and "Normal" levels. My proposal is making a virtual grid, say, 64x32, which would then be transposed onto the field, so then the snake could be 2 pixels wide.
  • The chosen difficulty isn't saved between game launches.
  • For some reason, the highscores aren't properly saved either.
  • Given the amount of globals involved, it would make sense to refactor the game into a class-based app.
  • The highscore file could be tracked in a standard ZPUI config.json instead (together with the last picked difficulty)
  • When the game is failed and the "Highscore: " screen is shown, the buttons don't react to keypresses (so the users keep pressing one of the buttons, which is then processed in the game's main menu, leading to unexpected results).
  • Also, for some reason, the game field is shown once again after the highscore is displayed (while scores are being saved?) Coupled with the previous bug, that adds to the user's disorientation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions