Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐍 Cobra: A Retro Snake Game in C

GitHub stars GitHub forks GitHub release

🎮 Game Overview

Cobra is an immersive snake game for Linux, crafted with passion and C programming prowess. Experience a nostalgic journey through retro-style gameplay with innovative features that set it apart from traditional snake games.

Main Menu Screenshot

✨ Standout Features

🚀 Cutting-Edge Gameplay

  • Animated Intro: Stunning ASCII Art animation
  • Retro Menu Design: Nostalgic user interface
  • Intelligent Enemies: A* algorithm for "smart" snake opponents
  • Dynamic Obstacles: Challenging game environment
  • Immersive Sound Effects: Bass library audio integration

🔜 Coming Soon

  • Leaderboard/Records System
  • Customization Options
  • Comprehensive Help Menu

🛠 Installation Guide

Prerequisites

  • Linux (tested on Ubuntu) or Windows 10/11 with MSYS2 UCRT64
  • Git
  • Basic development tools
  • GCC Compiler

1. Clone the Repository

git clone https://github.com/jancarauma/cobra.git
cd cobra

2. Build

No manual dependency installation is required. libastar is vendored as source (lib/libastar_0.9-2.tar.gz) and is built automatically into .deps/ the first time you run make — no root/admin access needed. The BASS runtime files (lib/libbass.so for Linux, bass.dll/bass.lib for Windows) are already included in the repository.

make
./cobra

If you ever want to force a full rebuild of the vendored dependencies, run make distclean first.

🎮 How to Play

Controls

  • ⬆️⬇️⬅️➡️: Navigate snake or menu
  • Space: Pause game
  • Enter: Select menu option

Windows (MSYS2/UCRT64)

The Windows port was tested with Windows 10/11 and MSYS2. Open the UCRT64 terminal and install the compiler and build tools:

pacman -S --needed mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-make

From the project directory, run:

mingw32-make.exe OS=Windows_NT
./cobra.exe

Keep bass.dll beside cobra.exe when running the game. The Windows port uses the native console input API for keys, configures the console as UTF-8, and uses the Windows timing API; no POSIX terminal library is required.

🖼 Gameplay Screenshots

Intro Screen Gameplay Animation Game Scene

🚀 Quick Start

cd cobra
make
./cobra

On Windows, use the MSYS2 UCRT64 terminal and run mingw32-make.exe OS=Windows_NT.

📦 Dependencies

  • libastar (Version 0.9)
  • bass (Latest version)

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contribution Guidelines

  • Follow existing code style
  • Write clear, commented code
  • Include tests for new features
  • Update documentation

🐛 Reporting Issues

Found a bug? Please open an issue with:

  • Detailed description
  • Steps to reproduce
  • Your environment details

🌟 Show Your Support

Give a ⭐ if you enjoyed the game!

📄 License

MIT License

📞 Contact

🏆 Acknowledgments

  • A* Library by Alexios.
  • BASS Library by UN4SEE.

About

Snake game written in C - animations, retro menu, smart snake enemies, sound effects.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages