Skip to content

meKushdeepSingh/SnakeGame

Repository files navigation

🐍 Snake Game

TypeScript Platform

A nostalgic Snake game built with React Native + TypeScript, featuring a responsive, notch-safe grid system and smooth gameplay. Perfect for learning grid logic, animation timing, and mobile-safe layouts.


📸 Preview

A preview of the application

Build Link

Download Android APK File


🚀 Features

  • 🎮 Classic snake movement with arrow/button controls
  • 🍎 Random food placement on a dynamic grid
  • 🧱 Safe area aware on iOS and Android (notch support)
  • ⚛️ Clean, modular TypeScript structure
  • 🧠 Grid-calculated boundaries (no overflow bugs)
  • 🔁 Automatic game reset on collision

🧱 Folder Structure

src/
├── assets/                     # Images, sounds, etc.
├── components/                 # Reusable UI components
├── constants/                  # Global constants (app-wide)
├── hooks/                      # Custom React hooks
├── modules/
│   └── SnakeGame/
│       ├── Controller.tsx           # Game control buttons
│       ├── SnakeGameScreen.tsx      # Main game screen
│       ├── SnakeGame.constants.ts   # Game-related constants
│       ├── SnakeGame.utils.ts       # Grid calculation utilities
│       └── index.ts                 # Barrel export for module
├── redux/                      # Redux store and slices (if used)
├── routes/                     # App navigation setup
├── services/                   # API integrations or helpers
└── utils/                      # Shared utility functions (e.g., colors)

📦 Setup Instructions

1. Clone & Install

git clone https://github.com/meKushdeepSingh/SnakeGame.git
cd SnakeGame
npm install
# or
yarn

2. iOS Setup (bare React Native only)

cd ios
pod install
cd ..
yarn ios

3. Android

yarn android

🛠️ Tech Stack

⚛️ React Native
🔷 TypeScript
📏 Dynamic layout calculation

🧠 Planned Improvements

⏸ Pause/Resume support
🔊 Sound effects
💾 High score persistence (AsyncStorage or SQLite)
🧍‍♂️ Swipe gesture controls

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published