https://github.com/rudi-q/tuesdae-rush-flutter
🚦 Tuesdae Rush - Traffic Intersection Game - Made w/ Flutter 💙
https://github.com/rudi-q/tuesdae-rush-flutter
cross-platform-game flutter-game traffic-simulation
Last synced: 7 months ago
JSON representation
🚦 Tuesdae Rush - Traffic Intersection Game - Made w/ Flutter 💙
- Host: GitHub
- URL: https://github.com/rudi-q/tuesdae-rush-flutter
- Owner: rudi-q
- License: other
- Created: 2025-06-28T16:29:39.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-09-04T09:44:27.000Z (9 months ago)
- Last Synced: 2025-11-01T13:27:53.656Z (7 months ago)
- Topics: cross-platform-game, flutter-game, traffic-simulation
- Language: Dart
- Homepage: https://tuesdae.games/
- Size: 3.62 MB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 🚦 Tuesdae Rush - Flutter Edition
> *Rush hour meets Tuesday calm - the perfect traffic management experience for ADHD minds*
A calming, ADHD-friendly traffic intersection management game built with Flutter. Experience the thrill of rush hour traffic while maintaining your zen. Help cars navigate through a busy intersection by controlling traffic lights and score points for safe passages.




## 🎮 Game Overview
**Tuesdae Rush** transforms everyday traffic management into an engaging, stress-free gaming experience. Players control traffic lights at a 4-way intersection, helping colorful cars pass through safely while avoiding collisions.
### Why "Tuesdae Rush"?
The name embodies the perfect balance of rush hour excitement with Tuesday's calm predictability - turning ordinary traffic management into something engaging and meaningful for ADHD minds that need structure and immediate feedback.
## ✨ Features
### 🎯 ADHD-Friendly Design
- **Immediate visual feedback** on all actions
- **No time pressure** - play at your own pace
- **Clear, simple objectives** with predictable patterns
- **Positive reinforcement** through score popups and visual effects
- **Calming color palette** to reduce visual stress
- **High contrast elements** for better focus
### 🚗 Vehicle Types & Behaviors
- **6 Different Vehicle Types:**
- 🚙 **Regular Cars** - Standard traffic behavior
- 🚑 **Ambulances** - Ignore traffic lights, flashing red/blue sirens
- 🚔 **Police Cars** - Aggressive drivers, may rear-end waiting vehicles
- 🚜 **Tractors** - Super slow, smoky exhaust effects
- 🚌 **School Buses** - Extra long, flashing stop signs and lights
- 😤 **Impatient Cars** - Distinctive colors, may ignore red lights
### 🚦 Traffic Management
- **Realistic traffic light system** with red/yellow/green indicators
- **Independent light control** - each direction operates separately
- **Visual glow effects** for active lights
- **Precise collision detection** with realistic vehicle stopping
- **Multiple control methods** (touch, keyboard, mouse)
### 📊 Scoring & Progression
- **Dynamic scoring system** with difficulty multipliers
- **Real-time statistics** tracking cars passed, crashed, and waiting
- **6 Achievement objectives** with bonus rewards
- **Success rate calculations** for performance tracking
- **Visual score popups** with particle effects
### 🎚️ Difficulty Levels
1. **Easy** (1.5x speed, 1x score) - Perfect for learning
2. **Medium** (2x speed, 1.5x score) - Balanced gameplay
3. **Hard** (2.5x speed, 2x score) - Challenging experience
4. **Extreme** (3x speed, 2.5x score) - For traffic masters
5. **Insane** (3.5x speed, 3x score) - Ultimate challenge
### 🎨 Visual Effects
- **Crash explosions** with particle physics
- **Success celebrations** with green particle bursts
- **Detailed vehicle graphics** with headlights, taillights, and special effects
- **Professional road markings** with crosswalks and lane dividers
- **Dynamic scenery** with trees and environmental elements
- **Gradient backgrounds** with subtle texture overlays
## 🚀 Getting Started
### Prerequisites
- Flutter SDK (3.0 or higher)
- Dart SDK (2.17 or higher)
- Android Studio / VS Code with Flutter extensions
- Git
### Installation
1. **Clone the repository**
```bash
git clone https://github.com/yourusername/tuesdae-rush-flutter.git
cd tuesdae-rush-flutter
```
2. **Install dependencies**
```bash
flutter pub get
```
3. **Run the game**
```bash
flutter run
```
### Platform-Specific Setup
#### 📱 Mobile (Android/iOS)
```bash
# Android
flutter run -d android
# iOS (macOS only)
flutter run -d ios
```
#### 🌐 Web
```bash
flutter run -d chrome
```
#### 💻 Desktop
```bash
# Windows
flutter run -d windows
# macOS
flutter run -d macos
# Linux
flutter run -d linux
```
## 🎮 How to Play
### Basic Controls
- **Touch/Tap**: Click any traffic light to toggle between red and green
- **Arrow Keys**: Use keyboard arrows (↑↓←→) to control specific lights
- **Number Keys**: Press 1-5 to change difficulty levels
- **Spacebar/Escape**: Pause and resume the game
- **R Key**: Restart after game over
### Game Objective
1. **Control traffic lights** to help cars pass through the intersection safely
2. **Avoid collisions** between vehicles from different directions
3. **Manage traffic flow** to prevent too many cars from waiting
4. **Complete objectives** for bonus points and achievements
5. **Maintain high efficiency** to avoid game over
### Traffic Light Logic
- **Red Light**: Cars stop 30 pixels before the intersection
- **Green Light**: Cars proceed through the intersection
- **Each direction is independent** - you can have multiple greens
- **Emergency vehicles** (ambulances, police) ignore traffic lights
### Scoring System
- **Base points per car**: Varies by difficulty (1-3 points)
- **Crash penalty**: -5 points (score cannot go below 0)
- **Objective bonuses**: 50-300 points for completing challenges
- **Success rate tracking**: Percentage of cars that pass safely
## 🏆 Objectives & Achievements
| Objective | Requirement | Bonus |
|-----------|-------------|--------|
| **Pass 20 Cars** | Get 20 cars through safely | +50 points |
| **Perfect Safety** | No crashes with 10+ cars passed | +100 points |
| **Pass 50 Cars** | Reach 50 successful passages | +150 points |
| **High Efficiency** | 85% success rate with 20+ cars | +200 points |
| **Century Mark** | Pass 100 cars successfully | +300 points |
| **Traffic Master** | Keep waiting cars ≤3 with 30+ passed | +250 points |
## 🛠️ Technical Architecture
### Project Structure
```
lib/
├── main.dart # Main app entry point and UI
├── game_state.dart # Game logic and state management
└── game_painter.dart # Graphics rendering and effects
```
### Key Components
#### `main.dart` (~500 lines)
- Flutter app setup and theming
- UI overlays (score, objectives, controls)
- Input handling (touch, keyboard)
- Responsive layout management
- Theme switching (dark/light mode)
#### `game_state.dart` (~600 lines)
- Complete game logic and mechanics
- Car spawning, movement, and collision detection
- Traffic light state management
- Objectives and scoring system
- Difficulty scaling and balance
#### `game_painter.dart` (~500 lines)
- CustomPainter for all game graphics
- Road, intersection, and scenery rendering
- Vehicle drawing with special effects
- Particle systems and animations
- Visual effects (explosions, glows, popups)
### Performance Optimizations
- **60 FPS game loop** with optimized rendering
- **Efficient collision detection** using distance calculations
- **Memory management** with proper object cleanup
- **Responsive scaling** that adapts to any screen size
- **Fixed random seeds** for consistent visual elements
## 🧠 ADHD-Friendly Design Principles
### Cognitive Load Management
- **Single primary task**: Focus only on traffic light control
- **Clear visual hierarchy**: Important elements have high contrast
- **Predictable patterns**: Cars follow consistent, logical rules
- **Immediate feedback**: Every action has instant visual response
### Attention & Focus
- **No time pressure**: Play at your comfortable pace
- **Multiple input methods**: Touch, keyboard, or mouse
- **Visual rewards**: Positive reinforcement through animations
- **Progress tracking**: Clear objectives and statistics
### Sensory Considerations
- **Calming color palette**: Forest green background reduces stress
- **High contrast**: Essential elements are clearly distinguishable
- **Consistent animations**: Smooth, predictable movement patterns
- **Optional sound**: Visual-first design doesn't rely on audio
### Executive Function Support
- **Clear cause-and-effect**: Traffic light → car behavior
- **Structured objectives**: Specific, achievable goals
- **Performance feedback**: Real-time success rate tracking
- **Error forgiveness**: Crashes reduce score but don't end game
## 🔧 Development
### Adding New Features
#### New Vehicle Type
```dart
// 1. Add to CarType enum in game_state.dart
enum CarType { regular, ambulance, police, newVehicle }
// 2. Update car creation logic
CarType _determineCarType() {
// Add probability logic
}
// 3. Add visual effects in game_painter.dart
void _drawNewVehicleEffects(Canvas canvas, double carWidth, double carHeight) {
// Custom rendering
}
```
#### New Objective
```dart
// Add to objectives map in game_state.dart
Map objectives = {
'new_objective': false,
};
// Add check in _checkObjectives()
if (condition && !objectivesCompleted['new_objective']!) {
objectives['new_objective'] = true;
objectivesCompleted['new_objective'] = true;
_awardObjectiveBonus('New Achievement', 100);
}
```
### Building for Release
#### Android APK
```bash
flutter build apk --release
```
#### iOS App Store
```bash
flutter build ios --release
```
#### Web Deployment
```bash
flutter build web --release
```
### Testing
```bash
# Run all tests
flutter test
# Run with coverage
flutter test --coverage
```
## 📱 Platform Support
| Platform | Status | Features |
|----------|--------|----------|
| 📱 **Android** | ✅ Full Support | Touch controls, haptic feedback |
| 📱 **iOS** | ✅ Full Support | Touch controls, haptic feedback |
| 🌐 **Web** | ✅ Full Support | Mouse and keyboard controls |
| 💻 **Windows** | ✅ Full Support | Keyboard and mouse controls |
| 💻 **macOS** | ✅ Full Support | Keyboard and mouse controls |
| 💻 **Linux** | ✅ Full Support | Keyboard and mouse controls |
## 🤝 Contributing
We welcome contributions! Please read our contributing guidelines:
### Getting Started
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
### Code Style
- Follow Flutter/Dart conventions
- Add comments for complex logic
- Update documentation for new features
- Maintain ADHD-friendly design principles
### Issue Reporting
- Use descriptive titles
- Include steps to reproduce
- Specify platform and Flutter version
- Add screenshots for visual issues
## 📋 Roadmap
### Near Term (v1.1)
- [ ] Sound effects and background music
- [ ] Haptic feedback for mobile devices
- [ ] Save/load game progress
- [ ] Additional vehicle types (motorcycles, emergency vehicles)
### Medium Term (v1.2)
- [ ] Multiple intersection layouts (T-junctions, roundabouts)
- [ ] Weather effects (rain, fog affecting visibility)
- [ ] Day/night cycle with lighting changes
- [ ] Achievement system with persistent unlocks
### Long Term (v2.0)
- [ ] Multiplayer cooperative mode
- [ ] Level editor for custom intersections
- [ ] Advanced AI vehicle behaviors
- [ ] Integration with accessibility services
## 🐛 Known Issues
- [ ] Very rarely, cars may spawn slightly off-road on first load (fixed on restart)
- [ ] Web version may have slight input delay compared to native apps
- [ ] Large screen desktop layouts could use better proportional scaling
## 📊 Performance Benchmarks
| Platform | FPS | Memory Usage | Startup Time |
|----------|-----|--------------|--------------|
| Android | 60 | ~50MB | 2-3 seconds |
| iOS | 60 | ~45MB | 1-2 seconds |
| Web | 50-60 | ~30MB | 3-4 seconds |
| Desktop | 60 | ~40MB | 1-2 seconds |
## 🚗 Tuesdae Assets Package
[](https://pub.dev/packages/tuesdae_assets)
[](LICENSE)
All the vehicle graphics and animations from **Tuesdae Rush** are now available as a **free, open-source Flutter package**!
**📦 [tuesdae_assets](https://pub.dev/packages/tuesdae_assets)** - animated vehicle widgets
- **MIT Licensed** - Use freely in any project, commercial or personal
- **6 Vehicle Types** - Cars, ambulances, police, tractors, school buses, and more
- **Fully Customizable** - Colors, sizes, directions, animations
- **Zero Dependencies** - Pure Flutter implementation
#### Installation of _tuesdae_assets_ 🚗 flutter package
```bash
flutter pub add tuesdae_assets
```
```dart
// Use in your app
TuesdaeVehicle.ambulance(
config: VehicleConfig(
isFlashing: true,
direction: VehicleDirection.north,
),
)
```
Perfect for traffic games, educational apps, city simulations, and any project that needs beautiful, animated vehicles. As we add new vehicle types and effects to Tuesdae Rush, they'll be added to the package for everyone to use!
## 📄 License
This project is **Source Available** for educational and research purposes only.
### What You Can Do:
- ✅ View and study the source code
- ✅ Learn from the implementation techniques
- ✅ Reference for educational projects
- ✅ Use code snippets for learning (with attribution)
### What You Cannot Do:
- ❌ Create modified versions or derivative works
- ❌ Distribute or redistribute the code
- ❌ Use in commercial products
- ❌ Remove copyright and attribution notices
### Commercial Licensing
Interested in commercial use or collaboration? Contact: reach@rudi.engineer
See the [LICENSE](LICENSE) file for complete terms.
## 🙏 Acknowledgments
- **Flutter Team** - For the amazing cross-platform framework
- **ADHD Community** - For feedback and design validation
- **p5.js** - Original prototype framework that made rapid iteration possible
- **Open Source Contributors** - For packages and inspiration
## 💬 Community & Support
- **Issues**: [GitHub Issues](https://github.com/yourusername/tuesdae-rush-flutter/issues)
- **Discussions**: [GitHub Discussions](https://github.com/yourusername/tuesdae-rush-flutter/discussions)
- **Email**: reach@rudi.engineer
- **Twitter**: [@TuesdaeRush](https://twitter.com/tuesdaerush)
## 🌟 Star History
If you find this project helpful, please consider giving it a star! ⭐
---
**Enjoy your Tuesday traffic management! 🚗💚**
*Made with ❤️ for the ADHD community*