A classic, retro-style "Snake" console game written in x86 Assembly Language (MASM 32-bit). The game runs in protected mode using the Irvine32 library and standard Win32 console APIs.
- Automatic Acceleration: The game starts at a comfortable speed delay of
150 ms. - Dynamic Progression: Every 5 points earned, the game speed automatically increases by
10 msto raise the stakes. - Speed Cap: The speed is capped at
50 msto keep the gameplay fast but responsive and fair.
- Regular Coin (80% Spawn Rate):
- Represented as a green
*. - Worth 1 point.
- Audio cue: A quick, crisp 1000 Hz beep.
- Represented as a green
- Golden Coin (20% Spawn Rate):
- Represented as a flashing yellow
$. - Worth 3 points and grows the snake by 3 units sequentially.
- Audio cue: A double ascending beep (1500 Hz and 2000 Hz).
- 2x Speed Boost: Eating a golden coin grants a 10-second speed multiplier (boost), reducing input delay by half. The active speed value displays on the scoreboard in real-time.
- Represented as a flashing yellow
- Real-time Record Updates: The scoreboard displays your current score and the highest score achieved during the current session.
- Personal Best Display: If you beat the current high score, the record updates instantly on the screen and is shown prominently on the Game Over screen.
- Synthesized 8-bit sound effects using the Win32
BeepAPI for game events:- Regular Coin: Single high beep.
- Golden Coin: Dual rapid ascending beeps.
- Game Over: A long, low-pitched warning drone (250 Hz for 500 ms).
Ensure Caps Lock is disabled before playing:
| Key | Action |
|---|---|
W |
Move Up |
A |
Move Left |
S |
Move Down |
D |
Move Right |
Enter |
Pause the Game (Press movement key to resume) |
X |
Quit the Game at any time |
This project is configured to build on modern systems using Visual Studio 2022 and the Irvine32 library.
- Visual Studio 2022 (with "Desktop development with C++" workload installed).
- Irvine32 Library: The library files should be placed at
C:\Irvine\irvine.
The Visual Studio solution and project files have been pre-configured with the following settings:
- Target SDK Version:
10.0.26100.0(Windows 10/11 SDK). - Platform Toolset:
v145(Visual Studio 2022 build tools). - Safeseh Image Generation: Set to
false(/SAFESEH:NO) to prevent link-time errors with legacy assembly libraries. - Irvine Paths: Pre-configured MASM include paths and linker search directories pointing to
C:\Irvine\irvine.
- Open the solution file
main.asm/main.asm.slnin Visual Studio 2022. - Select Release and x86 configurations.
- Right-click the solution in Solution Explorer and select Rebuild.
- Run the compiled executable
SnakeGame.exegenerated in the root folder.