Skip to content

I created a snake game using C++, without the use of any graphics library.

Notifications You must be signed in to change notification settings

Mysterious-Owl/Snake-game-using-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Snake game using C++

I created a snake game using C++, without the use of any graphics library.
To see how this games looks and work

https://www.youtube.com/watch?v=HlmdeXelTsM

I used following libraries-

  1. conio.h
  2. time.h
  3. synchapi.h
  4. windows.h

The code snake.cpp is final game consists of all features, which is too efficient and its speed is great (you can't play custom: 0), it doesn't have screen flickering issues, the size of board can be increased without compromising the effciency of game.

Features-

  • Various difficulty mode- Easy, Medium (Default), Hard, Custom (set the time in milliseconds)
  • P can pause the game
  • S can open the settings of game in exit screen or in welcome screen.
  • C can end the game
  • esc is used to exit the game at exit screen
  • It has many settings to modify the game.
    • Can pass though walls (modify in settings) (Default- No)
    • Can go reverse (modify in settings) (Default- No)
    • Can't die by touching its own body (modify in settings) (Default- No)
    • Change the dimensions of board (modify in settings) (Default- 27 118)
    • Two modes- Board can be made up of colours or of characters (modify in settings) (Default- Colour)

The other code snake_naive_approach.cpp is the naive approach to this game, which I formed initially, it overwrites the whole screen and then writes it, then clears then writes it, so its not so efficient, slow but has a smaller code (almost half).

About

I created a snake game using C++, without the use of any graphics library.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages