Skip to content

Latest commit

 

History

42 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐍 Snake Game – DOS Edition

C Turbo%20C DOS Retro

The Snake Game – DOS Edition is a retro-inspired implementation of the classic Snake game, designed for the DOS environment using Turbo C.
It features keyboard interrupts, direct cursor manipulation, custom ASCII graphics, and even sound effects for a nostalgic arcade feel 🎮.


🧠 Overview

This project brings the Snake Game to life in a DOS environment.
It leverages low-level hardware interrupts, cursor control, and direct screen drawing to simulate an interactive game experience.

The game includes:

  • Snake movement with arrow keys
  • Food spawning with ASCII art 🍎
  • Walls as obstacles
  • Music and scoring
  • Cursor control following the snake’s head

✨ Features

  • 🎮 Real-time Snake Movement with keyboard interrupt handler
  • 🍏 ASCII Art Food (a small apple drawn with characters)
  • 🧱 Walls & Obstacles dynamically spawned
  • 🎶 Retro Music Support
  • 📊 Score Tracking
  • Fast Rendering with display buffer (display_draft)
  • ⌨️ Low-level Keyboard Handler

📚 Table of Contents


🚀 How to Play

  1. Use Arrow Keys to move the snake.
  2. Eat the apple to grow and increase your score.
  3. Avoid crashing into the walls or yourself.
  4. Enjoy the retro sound effects and cursor tracking.

🛠️ Tech Stack

Category Technologies
Language C (Turbo C, Borland C)
Platform DOS
Graphics ASCII Characters + Drafting
Input Keyboard Interrupt Handler
Sound Turbo C <dos.h> + speaker
IDE Turbo C / DOSBox-X

🚧 Getting Started

### 1. Clone the project
git clone https://github.com/KoganTheDev/DOSBOX_Snake-RTOS-project.git

### 2. Open in Turbo C (or DOSBox-X with TCC) and run the batch file from src which runs the game

📂 Module Documentation

Module Summary
dosbox_snake.c Main loop
clock.c Controls the game`s timer and ticking speed using interrupts
cursor.c Controls the hardware text cursor (block mode + follow snake’s head).
food.c Spawns, draws, and checks collisions with food (ASCII apple).
snake.c Manages snake movement, growth, and self-collision detection.
wall.c Spawns walls as obstacles in the play area.
music.c Handles retro sound effects and background music.
score.c Tracks and updates player score.
screens.c Displays welcome, game, and game-over screens.
keyboard.c Interrupt-driven keyboard input handling.
game_management.c Orchestrates updates and rendering.
colors Handles the colors for the game screen

👨‍💻 Authors

Yuval Kogan LinkedIn GitHub
Almog Raz LinkedIn GitHub
Ron Salama LinkedIn GitHub

About

The Snake Game – DOS Edition is a retro-inspired implementation of the classic Snake game, designed for the DOS environment using Turbo C.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages