Skip to content

Raysh454/SnakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 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:

  4. Linux:

    make

    Windows:

    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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published