Snake Game

A modern, arcade-styled implementation of the classic Snake game

HTML5 TypeScript 5.x CSS3 Neo Arcade UI MIT License
🐍

Experience the Modern Snake

Click "Play Now" to start the game

🎮 Game Features

🐍

Dual-Snake System

Control your snake while an AI-controlled female snake competes for the same fruits, adding strategic depth to the classic formula.

🍎

Dynamic Fruit System

Red apples make you grow (70% spawn rate), yellow lemons shrink you (30% spawn rate) for strategic navigation through tight spaces.

🎨

Neo Arcade Design

Futuristic UI with glowing cyan grid, realistic 3D fruits, ambient background effects, and smooth animations.

🎵

Immersive Audio

Background music and sound effects for movement, eating, and game events. All audio optimized for comfortable gameplay.

Responsive Controls

Instant response with Arrow Keys or WASD. Space/P to pause, R for instant restart. No input lag or queuing delays.

🏆

Score Tracking

Real-time score updates with persistent high score storage. Track your progress across gaming sessions.

🎯 How to Play

Objective

Eat fruits to grow your snake and achieve the highest score possible while avoiding walls, your own body, and the AI snake.

Controls

Movement: Arrow Keys or WASD
Pause: Space or P
Restart: R key

Fruit Effects

🍎 Red Apples: Grow by 1 segment
🍋 Yellow Lemons: Shrink by 1 segment
Both count toward your score!

AI Opponent

The female snake uses pathfinding AI to chase you every 3 steps. Avoid contact and compete for fruits!

🔧 Technical Stack

📜

TypeScript

Type-safe game logic

🎨

HTML5

Modern web standards

CSS3

Animations & styling

🎵

Web Audio

Sound effects & music

📁 Project Structure

File Organization

source/game.ts - Main TypeScript source code
scripts/game.js - Compiled JavaScript with source maps
styles/main.css - Modern UI styling and animations
sounds/ - Background music and sound effects
images/ - Sprite sheets and visual assets
Test.htm - Game HTML shell for playing

📂 Get the Source Code

This Snake Game is open source and available on GitHub. You can view the complete source code, contribute improvements, or use it as a learning resource for your own HTML5 game development projects.

🔓 Open Source

Released under MIT License - free to use, modify, and distribute for any purpose.

📚 Educational

Well-documented code with clear architecture, perfect for learning TypeScript and game development.

🤝 Contribute

Open to contributions! Add new features, fix bugs, or improve the codebase.

🌟 Star on GitHub 🍴 Fork Repository

🚀 Quick Start

1. Clone Repository

Download the source code from GitHub to your local machine.

2. Compile TypeScript

Run tsc to compile the TypeScript source to JavaScript.

3. Open & Play

Open Test.htm in any modern web browser and start playing!