Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/farid-karimi/snake-game
A simple Snake game programmed with c++
https://github.com/farid-karimi/snake-game
cli cpp game game-development snake-game
Last synced: 2 months ago
JSON representation
A simple Snake game programmed with c++
- Host: GitHub
- URL: https://github.com/farid-karimi/snake-game
- Owner: Farid-Karimi
- License: mit
- Created: 2023-02-26T12:44:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-27T13:35:44.000Z (over 1 year ago)
- Last Synced: 2024-10-13T01:07:28.079Z (3 months ago)
- Topics: cli, cpp, game, game-development, snake-game
- Language: C++
- Homepage:
- Size: 96.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :snake:Snake Game Report
## Introduction
This report will discuss the design and implementation of a Snake game programmed in C++. The purpose of the game is to move the snake around the screen, eating "food" in order to grow and score points. The player must also avoid themselves, as this will cause them to lose the game.
## Design
The game is designed using 4 primary functions where each function is responsible for a specific set of tasks. The game consists of the following objects:
1. draw
2. input
3. logic
4. setup
## Implementation
The game was implemented using the C++ programming language. The game loop was written using a while loop, which will run until the game is over. The loop contains code for getting user input, updating the position of the snake, and detecting collisions.
The code for updating the position of the snake is responsible for getting the user input, updating the position of the snake, and detecting any collisions with walls or itself. If a collision is detected, the game will end. The code for generating food pieces is responsible for randomly generating food pieces on the board and updating the score when the snake eats one. There is also a high score data that makes the game more competitive for the player.
## Conclusion
This report discussed the design and implementation of a Snake game programmed in C++. The game loop was written using a while loop, and the code for updating the position of the snake and generating food pieces was also written. With this game, the player must move the snake around the board, eating food in order to grow and score points while avoiding the walls or themselves.
----
#### Winter 1401-1402