Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Nokia 3310 Snake Game

A faithful recreation of the classic Snake game from the Nokia 3310, built with pure HTML5, CSS3, and vanilla JavaScript.

![Snake Game](https://img.shields.io/badge/Game-Snake-green)
![Platform](https://img.shields.io/badge/Platform-Web-blue)
![No Dependencies](https://img.shields.io/badge/Dependencies-None-brightgreen)

## 🎮 Features

- Classic grid-based Snake gameplay
- Retro Nokia 3310 aesthetic with monochrome green display
- Keyboard controls (Arrow keys or WASD)
- On-screen button controls for mobile/touch devices
- High score tracking with localStorage
- Pause functionality
- Progressive difficulty (speed increases with score)
- Snake with animated eyes that follow direction

## 🚀 How to Play

1. **Open the game**: Simply open `snake.html` in any modern web browser
2. **Start**: Click the "START GAME" button
3. **Control the snake**: Use Arrow keys or on-screen buttons
4. **Objective**: Eat the food (black squares) to grow and increase your score
5. **Avoid**: Don't hit the walls or bite yourself!
6. **Beat your record**: Try to achieve the highest score possible

## ⌨️ Controls

- **Arrow Keys** or **WASD** - Move the snake (Up, Down, Left, Right)
- **Space** or **P** - Pause/Resume the game
- **On-screen buttons** - Click/touch controls for mobile devices
- **START button** - Start a new game or restart after game over

## 📋 Game Rules

1. The snake starts with 3 segments
2. Each piece of food eaten:
- Adds 10 points to your score
- Makes the snake grow by 1 segment
- Slightly increases the game speed
3. Game over conditions:
- Hitting any wall
- Snake colliding with itself
4. Your high score is automatically saved

## 🛠️ Technical Details

- **Technology**: Pure HTML5, CSS3, and vanilla JavaScript (ES6+)
- **Grid**: 20×15 cells (400×300 pixels)
- **Rendering**: HTML5 Canvas API
- **Frame Rate**: 60 FPS with fixed-timestep movement
- **Storage**: LocalStorage for persistent high scores
- **Dependencies**: None! Single self-contained HTML file

## 🌐 Browser Compatibility

Works in all modern browsers that support:
- HTML5 Canvas
- ES6 JavaScript
- LocalStorage API

Tested on:
- Chrome/Edge (latest)
- Firefox (latest)
- Safari (latest)

## 📁 File Structure

```
snake.html # Complete game in a single file
README.md # This documentation
```

## 🎨 Nokia 3310 Aesthetic

The game faithfully recreates the Nokia 3310 experience:
- Monochrome green display (#c7d6a4)
- Phone mockup with speaker slot
- Retro button controls
- Classic squared grid movement
- Simple but addictive gameplay

## 🎯 Tips & Tricks

1. **Plan ahead**: Look where the food will spawn and plan your route
2. **Use the edges**: Corner the food using walls strategically
3. **Avoid traps**: Don't box yourself in as you grow longer
4. **Smooth movement**: The snake can't reverse 180° instantly
5. **Speed increases**: The game gets faster as you score more points

## 🏆 Scoring

- **Food eaten**: +10 points each
- **High score**: Automatically saved to your browser
- **Speed bonus**: Game becomes more challenging as score increases

## 🚢 Deployment

The game is completely self-contained and can be:

1. **Local**: Open `snake.html` directly in any browser
2. **GitHub Pages**: Upload and enable GitHub Pages
3. **Web Server**: Host on any static web server
4. **Share**: Send the single HTML file to anyone

No build process, compilation, or dependencies required!

## 📜 License

This is a learning/recreation project. Free to use, modify, and distribute.

## 🎓 Credits

Inspired by the legendary Snake game from the Nokia 3310 (1998) that became a cultural phenomenon and introduced millions to mobile gaming.

---

**Enjoy the nostalgia!** 🐍📱
Loading