Skip to content

Repository files navigation

AI Snake '95 🐍

A retro-styled Snake game enhanced with artificial intelligence, featuring adaptive difficulty, smart food placement, and player behavior analysis. Built with vanilla JavaScript and styled to look like a classic Windows 95 application.

AI Snake '95 Screenshot

🎮 Features

Classic Snake Gameplay

  • Retro Win95 UI - Authentic Windows 95 styling with working window controls
  • Smooth Controls - Responsive keyboard and touch controls
  • Classic Mechanics - Grow by eating food, avoid walls and yourself

AI Enhancements

  • Adaptive Difficulty - Game speed adjusts based on your performance
  • Smart Food Placement - AI strategically places food to create interesting challenges
  • Player Analytics - Real-time analysis of movement patterns and skill level
  • Behavioral Adaptation - AI learns from your playstyle and adapts accordingly

Visual Feedback

  • AI Predictions - See predicted next moves with yellow highlights
  • Performance Metrics - Live difficulty bar and strategy display
  • Game Over Analysis - Detailed AI assessment of your gameplay

Mobile Support

  • Touch Controls - On-screen D-pad for mobile devices
  • Swipe Gestures - Intuitive swipe-to-move controls
  • Responsive Design - Adapts to different screen sizes
  • Haptic Feedback - Vibration feedback on supported devices

🚀 Play Now

Play AI Snake '95 Online

Or run locally:

  1. Clone this repository
  2. Open index.html in your web browser
  3. Start playing!

🎯 How to Play

Desktop

  • Use arrow keys to control the snake
  • Click Start to begin a new game
  • Use Pause to pause/resume
  • Click Reset to restart

Mobile

  • Swipe anywhere on the game canvas to move
  • Use the on-screen D-pad for precise control
  • Tap the screen to start a new game

AI Features

  • Toggle AI Predictions to see suggested moves
  • Enable Adaptive Difficulty for dynamic challenge scaling
  • Turn on Smart Food Placement for strategic food positioning

🤖 AI System

The AI engine analyzes your gameplay in real-time:

  • Movement Patterns - Detects repetitive behaviors and preferred directions
  • Skill Assessment - Evaluates performance on a 1-5 scale
  • Dynamic Adaptation - Adjusts game parameters based on your skill level
  • Strategic Challenges - Places obstacles and food to encourage varied gameplay

🛠️ Technical Details

Built With

  • Vanilla JavaScript - No frameworks, pure JS
  • HTML5 Canvas - Smooth 2D graphics rendering
  • CSS3 - Authentic Win95 styling with modern responsive design
  • Web APIs - Touch events, vibration, and performance timing

Architecture

  • Modular Design - Separate game engine, AI engine, and renderer
  • Real-time Analytics - Live player behavior analysis
  • Responsive Controls - Unified input handling for keyboard and touch
  • Error Recovery - Graceful handling of failures and edge cases

AI Algorithms

  • Pattern Recognition - Identifies common movement sequences
  • Performance Metrics - Tracks success rates and reaction times
  • Adaptive Algorithms - Dynamic difficulty and food placement
  • Behavioral Modeling - Predicts player actions based on history

📱 Browser Support

  • Desktop: Chrome, Firefox, Safari, Edge
  • Mobile: iOS Safari, Chrome Mobile, Samsung Internet
  • Features: Touch events, vibration API, canvas 2D

🎨 Screenshots

Desktop View

Desktop Screenshot

Mobile View

Mobile Screenshot

AI Analysis

AI Analysis Screenshot

🚀 Development

Project Structure

ai-snake-95/
├── index.html          # Main HTML file
├── game.js            # Game engine and logic
├── ai-engine.js       # AI system and analytics
├── styles.css         # Win95 styling and responsive design
├── .kiro/             # Development specs and documentation
└── README.md          # This file

Local Development

  1. Clone the repository
  2. Open index.html in a web browser
  3. No build process required - it's vanilla JavaScript!

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test on both desktop and mobile
  5. Submit a pull request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

  • Inspired by the classic Snake game
  • Windows 95 UI design patterns
  • Modern AI and machine learning concepts
  • Retro gaming aesthetics

🐛 Issues & Feedback

Found a bug or have a suggestion? Please open an issue on GitHub.


Enjoy playing AI Snake '95! 🎮✨

Releases

Packages

Contributors

Languages