Skip to content

Whether you're a Linux user in need of a quick distraction or a coder seeking terminal-based inspiration, the Snake Game for Linux Terminal offers a fun and accessible gaming experience straight from the command line.

License

Notifications You must be signed in to change notification settings

TensorPhobia/Snake-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snakes 🐍

snakes logo

🎮 How to Play:

Players navigate the snake using arrow keys or specified controls, guiding it to consume food items randomly placed within the game area. As the snake consumes food, it grows longer, making navigation more challenging. The game ends if the snake collides with itself or the boundaries, and players can see their score.

🕹️ Controls:

  • Use the arrow keys to control the snake's movement:

    • Up Arrow: Move the snake upwards.
    • Down Arrow: Move the snake downwards.
    • Left Arrow: Move the snake to the left.
    • Right Arrow: Move the snake to the right.
  • For changes to controls, modify the controls enum inside src/header files/control_module.h.

control customization code

✨ Features:

  • FPS Cap Customization: Take control of the game's speed by adjusting the frames per second (FPS) cap. Ideal for larger monitors where quicker snake movement enhances gameplay, Simply adjust the source file in src/header files/settings_module.h.

  • Terminal Theme Adjustment: The game adjusts to your terminal theme, ensuring it matches your taste straight on without any additional configurations.

  • Customization via Flags: Customize your gaming experience by passing flags to adjust various settings according to your preferences.

  • Theme Customization: Want to add your own theme? No problem! Simply adjust the source file in src/source files/theme_module.c to append your personalized theme to the game.

snake game auto detect themes snake game auto detect themes snake game auto detect themes

📦 Run/Compile:

To compile and run the Snake Game, you'll need any C compiler with the standard library and ncurses library installed. Follow these steps:

  1. Compile from Source:

    • Ensure you have a C compiler installed on your system.
    • Make sure the ncurses library is also installed. You can typically install it using your package manager.
    • Navigate to the project directory and run make to build the project.
  2. Run the Compiled Binary:

    • After successful compilation, execute the compiled binary by entering:
      ./snake.out
  3. Run the Precompiled Binary:

    • If you prefer not to compile the game yourself, follow these steps:

      a. Navigate to the release folder:

      cd release

      b. Run the precompiled binary:

      ./snake.out

      Remember to grant necessary permissions to the binary if needed:

      chmod +x snake.out

❤️‍🔥 Acknowledgment:

Special thanks to @haydraa for dedicating time and effort to review the code, providing valuable feedback, and contributing to the improvement of the Snake Game.


Made with ❤️ in Tunisia 🇹🇳

About

Whether you're a Linux user in need of a quick distraction or a coder seeking terminal-based inspiration, the Snake Game for Linux Terminal offers a fun and accessible gaming experience straight from the command line.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published