Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🐍 Snake Game

A simple console-based Snake Game built in C++ using basic game programming concepts.

The player controls the snake, collects food to increase the score, and avoids hitting the snake's own body.

Features

  • W A S D keyboard controls
  • Random food generation
  • Score tracking
  • Snake grows after eating food
  • Collision detection
  • Game over condition
  • Boundary wrap-around
  • Simple console interface

Tech Stack

  • C++
  • Standard Library
  • Windows Console Input

How to Run

This project uses Windows-specific console functions such as conio.h and windows.h.

Compile snake.cpp with a C++ compiler on Windows and run the generated executable.

Example:

g++ snake.cpp -o snake.exe
snake.exe

Controls

Key Action
W Move Up
A Move Left
S Move Down
D Move Right
X Quit Game

Concepts Practiced

  • Variables and data types
  • Functions
  • Loops and conditions
  • Vectors
  • Keyboard input
  • Random number generation
  • Collision detection
  • Basic game logic

Note

This is a beginner-level C++ project created for learning programming and game logic. It uses a console interface rather than a graphical game engine.

Author: Anshul Rajput

About

This project is a C++ graphics application built to demonstrate how fundamental programming concepts can be combined with visual creativity. Using libraries like SFML/SDL/OpenGL (depending on what you chose), the project showcases interactive graphics, smooth rendering, and real‑time user input handling.

Topics

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages