Skip to content

enesmuzaffer22/cs2-aim-training

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฏ CS2 Aim Training

Modern and advanced Counter-Strike 2 aim training application. Improve your aim with real CS2 sensitivity settings, track your performance, and break your records!

โœจ Features

๐ŸŽฎ Game Modes

  • ๐ŸŽฏ Circle Target: Hit randomly appearing circles (60 seconds)
  • โšก Reaction Time: Test your reflexes (2-6 seconds interval)

๐Ÿ”ง CS2 Integration

  • Real CS2 Sensitivity: Use your in-game sensitivity settings
  • DPI Calculation: Effective DPI calculation
  • Mouse Movement: Real CS2 mouse movement system

๐Ÿ“Š Statistics System

  • Detailed Charts: Performance graphs with Recharts
  • Score Tracking: Cloud-based score storage with Firestore
  • Progress Analysis: View improvement over time
  • Best Scores: Track personal records

๐Ÿ” User System

  • Firebase Auth: Secure login/register system
  • User Profile: Personal information and logout
  • Protected Routes: Secure page access

๐Ÿš€ Installation

Requirements

  • Node.js 20.16.0+
  • npm 10.8.2+

Project Setup

# Clone the project
git clone [repo-url]
cd cs2-aim-training

# Install dependencies
npm install

# Setup environment variables
cp .env.example .env
# Edit .env file with Firebase config details

# Start development server
npm run dev

Firebase Setup

  1. Create new project on Firebase Console
  2. Enable Authentication (Email/Password)
  3. Enable Firestore Database
  4. Add web app and get config details
  5. Fill .env file with Firebase config:
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_auth_domain
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_storage_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id

๐ŸŽฏ Usage

Getting Started

  1. Open the app: http://localhost:5173
  2. Create account or login
  3. Set your CS2 sensitivity settings in main menu
  4. Adjust DPI value

Playing Games

  1. Circle Target: Hit random circles in fullscreen mode
  2. Reaction Time: Click immediately when you see blue screen
  3. Statistics: Track your performance with graphs

Sensitivity Settings

  • Enter your CS2 sensitivity value
  • Specify your mouse DPI
  • Effective DPI calculated automatically
  • Settings saved automatically

๐Ÿ“ฑ Technologies

Frontend

  • React 18: Modern UI framework
  • Vite: Fast build tool
  • Tailwind CSS: Utility-first CSS framework
  • React Router: Client-side routing
  • Recharts: Data visualization

Backend

  • Firebase Auth: User authentication
  • Firestore: NoSQL database
  • Real-time: Live data synchronization

Game Engine

  • Pointer Lock API: Fullscreen mouse control
  • CS2 Sensitivity: Real game sensitivity
  • Performance Optimized: GPU accelerated movements

๐Ÿ“Š Scoring System

Circle Target

  • Score: Number of targets hit
  • Accuracy: Hit percentage (hit/total shots)
  • Duration: 60 seconds
  • Storage: Saved in Firestore

Reaction Time

  • Time: In milliseconds
  • Categories:
    • ๐Ÿš€ Super Fast (< 200ms)
    • โšก Very Good (200-300ms)
    • ๐Ÿ‘ Good (300-400ms)
    • ๐ŸŒ Slow (> 400ms)

๐Ÿ› ๏ธ Development

Commands

# Development server
npm run dev

# Production build
npm run build

# Preview production build
npm run preview

# Linting
npm run lint

Project Structure

src/
โ”œโ”€โ”€ components/          # React components
โ”‚   โ”œโ”€โ”€ Auth.jsx        # Login/Register
โ”‚   โ”œโ”€โ”€ MainMenu.jsx    # Main menu
โ”‚   โ”œโ”€โ”€ CircleTargetGame.jsx
โ”‚   โ”œโ”€โ”€ ReactionTimeGame.jsx
โ”‚   โ””โ”€โ”€ Statistics.jsx  # Statistics page
โ”œโ”€โ”€ hooks/              # Custom hooks
โ”‚   โ””โ”€โ”€ useAuth.js      # Authentication hook
โ”œโ”€โ”€ services/           # API services
โ”‚   โ””โ”€โ”€ scoreService.js # Score management
โ”œโ”€โ”€ firebase/           # Firebase config
โ”œโ”€โ”€ utils/              # Helper functions
โ””โ”€โ”€ assets/             # Static files

๐ŸŽฎ CS2 Sensitivity Calculation

// Effective DPI = CS2 Sensitivity ร— Mouse DPI
const effectiveDPI = sensitivity * dpi;

// CS2 YAW value: 0.022 (constant)
const yaw = 0.022;

// Mouse movement calculation
const rotationX = movementX * sensitivity * yaw;
const rotationY = movementY * sensitivity * yaw;

๐Ÿ› Known Issues

  • Firestore composite index requirement (solved with simple queries)
  • Pointer Lock API may not be fully supported in some browsers
  • Limited support on mobile devices

๐Ÿค Contributing

  1. Fork the project
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add some amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Create Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License.

๐ŸŽฏ Future Features

  • More game modes
  • Multiplayer support
  • Leaderboard system
  • Crosshair customization
  • Sound effects
  • Mobile responsive design
  • Steam integration

๐ŸŽฎ Good luck! Improve your aim, break your records! ๐ŸŽฏ

Releases

No releases published

Packages

No packages published

Languages