Skip to content

A simple Snake game implemented in C using SDL2.

Notifications You must be signed in to change notification settings

HuzPro/SnakeGame

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game with SDL2 in C

A simple Snake game implemented in C using SDL2.

Overview

This project showcases a Snake game developed using the SDL2 library in C. The game revolves around a growing snake that feasts on apples while evading collisions with itself. Additionally, when encountering the window boundaries, the snake reappears on the opposite side of the screen.

Features

  • Classic Snake gameplay
  • SDL2 for graphics and input handling
  • Collision detection
  • Menu functionality

Screenshots

Menu GamePlay

Getting Started

Prerequisites

  • C compiler (GCC recommended) with MinGW for Windows
  • SDL2 library installed

Installation

  1. Clone the repository:

    git clone https://github.com/HuzPro/SnakeGame.git
  2. Download the additional files from this link and place them in the same directory as the cloned repository files.

  3. Compile the game:

    gcc -std=c99 main.c -I SDL2 -L lib -Wall -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf -mwindows -o main.exe
    

Usage

Run the compiled executable to start the game:

.\main.exe

Use arrow keys to control the snake and mouse to navigate the menu.

Game Controls

  • Arrow keys: Move the snake
  • Escape key: Open/close menu

Game Controls

  • Arrow keys: Move the snake
  • Escape key: Open/close menu

Acknowledgements

  • SDL2 Library: Thanks to the creators and maintainers of SDL2 for providing the graphics and input handling library.

  • Sherry: Special thanks to Sherry for their collaboration on various aspects of the game's development.

  • Documentation: Gratitude to SDL2 documentation for their informative resources, great tutorials and libraries that aided in understanding game development using SDL2.

Collaboration

This project was a collaborative effort between Huz and Sherry. Both contributors worked together to develop and refine various aspects of the game, including gameplay, graphics, and functionality.

Feel free to add more details or specify each person's contributions if needed.

This README.md provides an introductory overview, installation instructions, usage details, controls and collaboration details.

About

A simple Snake game implemented in C using SDL2.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.9%
  • Makefile 1.1%