Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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++

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