Skip to content

This project is a version of the classical snake game arcade that I developed to practice, and Improve, my skills in POO, data structures, C++, STL, and to learn more about some GitHub features.

License

VitorCMatias/snake_game

Repository files navigation

Snake Game in C++

Table of Contents

Introduction

This project is a version of the classical snake game arcade that I developed to practice, and improve, my skills in POO, data structures, file manipulation, C++, and its STL.

I've also used the Singleton design pattern, to have only a single instance of a class. And some native Windows features, to change text and console colours or some DOS commands.

Here we have an image of the game running:

Libraries and tools

Colours

To print coloured chars and change the background colour, I used the ANSI escape code I preferred to do such implementation to use a native function of Windows and C++, instead of import a external library, making the final program a bit shorter.

Moreover, its colour range fitted to the necessity of my project, and the scape code was an easy tool, the only thing I had to do was print my code in this format:

cout << COLOUR_CODE << "Text" << RESET_COLOR_SCHEME;

Compilation

If you wish to compile the code and run it on your computer, you need to use the following terminal command:

g++ -std=c++17 -O2 Header.hpp Source.cpp Snake.cpp Main.cpp -o snake_game

Observations

  • This code uses the library <Windows.h>, that only works on Windows platform.

About

This project is a version of the classical snake game arcade that I developed to practice, and Improve, my skills in POO, data structures, C++, STL, and to learn more about some GitHub features.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages