Skip to content

Outscal-Projects/Linked-List-Snake

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

128 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ Linked List Snake

A SFML-based version of the classic Snake game implemented in C++. This project uniquely integrates Linked List and Doubly Linked List data structures to represent the snake and simulate operations based on the food it consumes.

๐ŸŽฎ Gameplay Features

  • SFML-based interface with keyboard input
  • Classic snake movement and growth
  • Different food types trigger unique linked list operations
  • Game over on self-collision

๐Ÿง  Data Structures in Action

This project uses:

  • The snake body is managed using a Singly Linked List or a Doubly Linked List, based on the selected branch, with food items triggering corresponding operations.

  • Food-triggered behaviors:

    • ๐Ÿ” Burger - Insert at head
    • ๐Ÿง€ Cheese - Insert in middle
    • ๐Ÿ• Pizza - Insert at tail
    • ๐ŸŽ Apple - Delete at head
    • ๐Ÿฅญ Mango - Delete at middle
    • ๐ŸŠ Orange - Delete at tail
    • โ˜ ๏ธ Poison - Delete half nodes
    • ๐Ÿท Alcohol - Reverse Direction
  • Each food item maps to a specific linked list operation, turning gameplay into a fun data structure demo.

๐Ÿ› ๏ธ Technologies Used

  • C++
  • Object-Oriented Programming (OOP)
  • SFML

๐Ÿš€ How to Run

Steps

git clone https://github.com/Chintan-Patel-Games/Linked-List-Snake.git
  • Run the game

๐Ÿ“š Concepts Demonstrated

  • Singly and Doubly Linked Lists
  • Dynamic memory management
  • Collision detection
  • Input handling and game loop structure
  • Encapsulation and modular design using C++

About

A sfml-based version of the classic Snake game implemented in C++. This project uniquely integrates Linked List and Doubly Linked List data structures to represent the snake and simulate operations based on the food it consumes.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages