Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐍 Snake Game Project

Snake Logo
Snake – The Desert King

A classic Snake game built using C++ and the SDL2 library as a final project for the second semester of the first year. This game includes features such as player history, name input, and best score tracking.

  • Course: CSE-1211 (Fundamentals of Programming)
  • Institution: University of Dhaka
  • Developer: Mehedi Hasan

📜 About the Project

This project recreates the timeless Snake game, where players control a snake that grows longer by consuming food items while avoiding collisions with itself and screen borders. It runs offline in single-player mode, keeping a record of player history and the highest score.


🎮 Features

  • Single-player gameplay: Enjoy a classic offline game mode where you control a snake.
  • Player Name Input: Input and save your name along with your score.
  • Score History: Keep track of scores from previous games.
  • Best Score Display: See the highest score achieved across all games.
  • Offline Play: No internet connection required.

🖼️ Screenshots

Main Menu Gameplay
Main Menu. Gameplay.

🛠️ Tools, Technologies, and Frameworks Used

  • C++ Programming Language: Handles core game logic and functionality.
  • SDL2 Library: Powers graphics and input handling.
    • SDL2_ttf: Renders text elements, such as scores and player names.
    • SDL2_image: Manages images for game graphics.

🚀 Getting Started

Prerequisites

  • C++ Compiler (e.g., GCC or MSVC)
  • SDL2 Library installed (along with SDL2_ttf and SDL2_image if used). You can download it from SDL2

Running the Game

  1. Clone the repository or download the source code.

    git clone https://github.com/hasanmehediii/CSE-1211-Project
    cd CSE-1211-Project
  2. Ensure SDL2 is properly installed.

     sudo apt update
     sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev
  3. Compile the project using your C++ compiler. For example:

    g++ -o main main.cpp -lSDL2 -lSDL2_ttf -lSDL2_image
    
  4. Run

    ./main
    

📬 Contact

If you have any questions, feedback, or suggestions, feel free to reach out!

👤 Mehedi Hasan

About

Its a beginner type snake game using SDL2 library along with C++ to develop. Scoring system is available to track players. its the First Year Second Semester Final Project (Done)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages