Nibble Game is a classic "snake" game inspired by popular games from the 70s and the version available on Nokia phones. The project is implemented using the SFML library, which efficiently handles graphics and events.
This project utilizes the following libraries:
- SFML – graphics and event handling
- ranges – sorting
- threads – multithreading
- filesystem – file and folder management
- regex – regular expressions handling
- concept – defining template requirements
When the game starts, the player is presented with the main menu, which includes:
- Start Game – begins a new game
- Game Speed – adjusts the game speed (range 1-30)
- Lives – selects the number of lives
- Exit Game – exits the application

The player controls a snake, collecting food while avoiding obstacles. The main goal is to achieve the highest possible score.
- Arrow keys (up, down, left, right) – control the snake's movement
- The snake starts as a double segment.
- Food values range from 1 to 9 – when eaten, the snake grows, and the score increases by the food value × 100.
- The game ends when the number of lives reaches 0.
- Colliding with obstacles or itself decreases a life and deducts 1000 points.
The highest scores are saved in the leaderboards.txt file and displayed in descending order.

- position, thickness – object position and thickness
setPosition(),setThickness(),getPosition(),getThickness()– basic methodsdraw()– virtual method for rendering the object
getCenterPosition()– returns the frame center positiondraw()– renders the frame
- length, direction – obstacle length and direction
checkCollision(head),draw(),getLength(),getDirection()
checkCollision(snake, obstacles)– checks point collisionresetValue(),generatePoint()– generates a new point
- segments, direction,
move(),grow(),resetSnake(),checkCollision(),checkCollisionWithObstacles(),draw()
- score, lives, level, game_speed, leaderBoard
gameStart(),gameEnd()– controls the game flow
- Start the program.
- The snake responds correctly to movement controls.
- Food spawns correctly and disappears when eaten.
- The game ends when the snake collides.
- The menu functions properly.
This project provided valuable experience in object-oriented programming, including:
- Inheritance, polymorphism, and class relationships
- Event handling with SFML
- Code structure planning
- Testing and debugging using GitHub
Regular testing and version control ensured a stable and reliable application.


