Skip to content

About

A new game to improve my skills.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

89 Commits

Folders and files

Repository files navigation

Sliding Arrow Game

A fast-paced Unity mobile game designed to train your brain's reaction time to visual cues. Players must quickly slide arrows in specific directions based on different arrow types, each with unique rules that challenge your cognitive processing speed.

Game Overview

This infinite runner-style brain training game presents players with different colored arrows that must be swiped in specific directions within a limited time frame. The game progressively challenges your ability to quickly process visual information and respond with the correct directional input.

Arrow Types & Mechanics

The game features four distinct arrow types, each with unique behavioral rules:

1. Classic Arrow (directionToShowModifier = 0)

  • Rule: Swipe in the direction the arrow is pointing
  • Visual: Points in the direction you need to swipe
  • Example: Arrow points right → Swipe right

2. Opposite Arrow (directionToShowModifier = 2)

  • Rule: Swipe in the opposite direction to where the arrow points
  • Visual: Yellow-colored arrow
  • Example: Arrow points right → Swipe left

3. Clockwise Arrow (directionToShowModifier = 1)

  • Rule: Swipe 90° clockwise from the arrow's direction
  • Visual: Purple-colored arrow
  • Example: Arrow points right → Swipe down

4. Counter-Clockwise Arrow (directionToShowModifier = 3)

  • Rule: Swipe 90° counter-clockwise from the arrow's direction
  • Visual: Green-colored arrow
  • Example: Arrow points right → Swipe up

Core Features

🎯 Gameplay Mechanics

  • Time Pressure: Each arrow has a limited duration (configurable per arrow type)
  • Lives System: Start with 3 lives, lose one for each mistake
  • Life Regeneration: Earn back lives by maintaining consecutive successful swipes
  • Scoring System: Points based on arrow type, reaction speed, and accuracy
  • Infinite Progression: Endless gameplay with increasing challenge

🎨 Visual & Animation System

  • Smooth Animations: Custom appear/disappear animations for arrows
  • Particle Effects: Swipe effects that spawn from screen edges
  • UI Animations: Score updates, life indicators, and game over sequences
  • Visual Feedback: Success/fail animations for immediate response feedback

📚 Tutorial System

  • Interactive Learning: Step-by-step introduction to each arrow type
  • Visual Guidance: Small directional indicators show where to swipe
  • Progressive Difficulty: Master each arrow type before moving to the next
  • Requirement-Based Progression: Complete 8 consecutive successes per arrow type

🎮 User Interface

  • Score Display: Real-time score updates with bonus calculations
  • Lives Indicator: Visual representation of remaining lives
  • High Score Tracking: Personal best score persistence
  • Responsive Design: Optimized for mobile touch input

Technical Implementation

Architecture

  • Modular Design: Separate managers for arrows, input, gameplay, and UI
  • Event-Driven System: Decoupled communication between game components
  • Singleton Pattern: Global access to core managers
  • Animation Integration: Unity Animator integration with custom state machine behaviors

Key Systems

Arrow Management

// Dynamic arrow selection with weighted probability
SelectedArrow = Arrows[RandomUtility.SelectRandomWeightedIndex(Arrows)];

// Direction calculation based on arrow type
Direction directionToShow = (Direction)(((int)direction + directionToShowModifier) % 
    DirectionUtility.kDirectionCount);

Input Detection

  • Touch-based swipe detection with configurable sensitivity
  • Direction calculation from touch delta positions
  • Real-time input validation against expected direction

Scoring Algorithm

  • Base score per arrow type with configurable values
  • Speed bonus using animation curves
  • Penalty system for incorrect inputs
  • Consecutive success rewards

Project Structure

Assets/Scripts/
├── Arrow.cs              # Individual arrow behavior and properties
├── ArrowManager.cs       # Arrow spawning and selection logic
├── PlaymodeManager.cs    # Core gameplay loop and state management
├── InputManager.cs       # Touch input detection and processing
├── Tutorial.cs           # Progressive tutorial system
├── PlaymodeUiManager.cs  # UI updates and animations
├── ScoreManager.cs       # Scoring calculations and persistence
├── SwipeEffectSpawner.cs # Particle effects for swipe feedback
├── Direction.cs          # Direction enum and utilities
└── Utility/
    ├── DirectionUtility.cs   # Direction conversion utilities
    ├── RandomUtility.cs      # Weighted random selection
    └── Countdown.cs          # Timer management

Learning Objectives Achieved

Unity Skills

  • Animation System: Complex state machines with custom behaviors
  • UI/UX Design: Responsive mobile interface with smooth transitions
  • Event Systems: Decoupled architecture using C# events
  • Mobile Optimization: Touch input handling and performance considerations

Game Design Principles

  • Progressive Difficulty: Gradual introduction of complex mechanics
  • Immediate Feedback: Visual and audio responses to player actions
  • Engagement Mechanics: Lives system and score progression
  • Accessibility: Clear visual distinctions between arrow types

Programming Concepts

  • Design Patterns: Singleton, Observer, State Machine
  • Modular Architecture: Separation of concerns across managers
  • Performance Optimization: Efficient object pooling and animation handling
  • Data Persistence: High score saving and tutorial progress

Getting Started

Requirements

  • Unity 2019.4 LTS or newer
  • Mobile device with touch input support
  • Minimum Android API level 21 or iOS 9.0

Controls

  • Swipe: Slide your finger in the direction required by the arrow type
  • Speed: React quickly before the timer runs out
  • Accuracy: Incorrect swipes cost lives

Game Tips

  • Start with the tutorial to understand each arrow type
  • Focus on the arrow color to quickly identify the rule
  • Practice makes perfect - muscle memory develops over time
  • Don't panic when the timer is low - accuracy beats speed

About

A new game to improve my skills.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages