mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-20 13:50:46 +00:00
- Changed CSS file paths in index.html and show.html.erb to reflect new directory structure under public/break_escape. - Added a new tutorial.css file with styles tailored for the tutorial system, ensuring a cohesive pixel-art aesthetic. - Enhanced the tutorial manager to track player interactions, including clicks to move and inventory item usage, improving the tutorial experience for new players. - Updated tutorial steps to dynamically include objectives based on the current scenario. Files modified: - index.html: Updated CSS links. - show.html.erb: Updated CSS links. - tutorial.css: New styles for the tutorial system. - player.js: Added notifications for player actions. - tutorial-manager.js: Enhanced logic for tracking tutorial progress and objectives. - interactions.js: Added notifications for inventory interactions.
226 lines
7.8 KiB
Markdown
226 lines
7.8 KiB
Markdown
# Tutorial UI Improvements
|
|
|
|
## Overview
|
|
|
|
The tutorial system UI has been significantly improved to match BreakEscape's established design language and provide a more polished, cohesive experience for new players.
|
|
|
|
## Design Language Alignment
|
|
|
|
The tutorial system now consistently uses:
|
|
|
|
- **Dark backgrounds**: `rgba(0, 0, 0, 0.95)` for modals/panels (matching other UI elements)
|
|
- **Transparent overlays**: No dark screen overlay - game remains visible
|
|
- **Sharp corners**: No border-radius (pixel-art aesthetic)
|
|
- **2px borders**: Using `#444` for standard borders, `#00ff88` for accented elements
|
|
- **Typography**:
|
|
- `Press Start 2P` for headers and titles
|
|
- `VT323` for body text and instructions
|
|
- **Accent color**: `#00ff88` (cyan-green) for primary actions and highlights
|
|
- **Secondary colors**:
|
|
- `#4ade80` for completion/success states
|
|
- `#ff6b6b` for warnings/skip actions
|
|
- **Z-index hierarchy**: Tutorial at 1400, below minigames (1500+) and dialogue systems
|
|
|
|
## Key Improvements
|
|
|
|
### 1. Visual Consistency
|
|
|
|
**Before**: Tutorial used gradients and rounded corners that didn't match the game's pixel-art aesthetic.
|
|
|
|
**After**:
|
|
- Removed rounded corners completely
|
|
- Replaced gradients with solid dark backgrounds
|
|
- Added subtle inner glow effects using `::before` pseudo-elements
|
|
- Consistent border styling with `#00ff88` accent color
|
|
|
|
### 2. Enhanced Buttons
|
|
|
|
**Improved button styling with:**
|
|
- 3D depth effect using layered box-shadows
|
|
- Proper active states that respond to clicks
|
|
- Better hover animations with translateY transforms
|
|
- Color consistency with the game's primary accent color
|
|
|
|
### 3. Tutorial Panel Positioning
|
|
|
|
**Changed**: Panel now sits at `bottom: 90px` to properly clear the inventory bar (80px height)
|
|
|
|
**Why**: Prevents overlap with the game's HUD elements while maintaining visibility
|
|
|
|
### 4. Visual Feedback
|
|
|
|
**Added animations:**
|
|
- Pulsing border effect on objective box (using `objective-pulse` animation)
|
|
- Completion state with color change to green (`#4ade80`)
|
|
- Smooth transitions between states
|
|
|
|
**JavaScript enhancements:**
|
|
- Added `.completed` class when objectives are finished
|
|
- Visual indicator shows immediately when player completes a step
|
|
- Player must click "Continue" after completing each step (no auto-advance)
|
|
- All steps now track real player actions (movement, running, interaction, click-to-move, inventory clicks)
|
|
- Inventory step teaches players to click items like the Notepad to access notes
|
|
- Final "Objectives" step shows Continue button immediately for player to proceed at their pace
|
|
- **Smart step detection**: Objectives step automatically skipped if scenario has no objectives
|
|
- Gives players complete control over tutorial pacing
|
|
|
|
### 5. Typography Improvements
|
|
|
|
**Enhanced readability:**
|
|
- Increased font sizes:
|
|
- Body text: `20px` → `22px`
|
|
- Progress indicator: `18px` → `20px`
|
|
- Titles: Added consistent `letter-spacing: 1px`
|
|
- Better text shadows on accent color elements
|
|
- Improved line-height for multi-line text
|
|
|
|
### 6. Accessibility
|
|
|
|
**Added support for:**
|
|
|
|
- **Keyboard navigation**:
|
|
- Visible focus states with 3px solid outlines
|
|
- Proper tab order through interactive elements
|
|
|
|
- **Reduced motion**:
|
|
- Respects `prefers-reduced-motion` media query
|
|
- Disables all animations and transforms when requested
|
|
|
|
- **High contrast mode**:
|
|
- Increases border widths to 3px
|
|
- Enhances box-shadows for better visibility
|
|
- Bolds important text
|
|
|
|
### 7. Mobile Responsiveness & Screen Positioning
|
|
|
|
**Improved mobile experience:**
|
|
- Adjusted font sizes for smaller screens
|
|
- Reduced padding and margins appropriately
|
|
- Maintained proper spacing above inventory on mobile
|
|
- Buttons scale better on touch devices
|
|
- Max width set to 95% for better edge spacing
|
|
|
|
**Screen positioning improvements:**
|
|
- Panel positioned at `bottom: 100px` (was 90px) for better clearance
|
|
- Added `max-height: calc(100vh - 120px)` to prevent panel going off top of screen
|
|
- Added scrollable content with styled scrollbar if panel content is too tall
|
|
- Works on all screen sizes and orientations
|
|
|
|
### 8. Polish & Details
|
|
|
|
**Small touches that matter:**
|
|
- Inner glow effect on modals using `::before` pseudo-element
|
|
- Colored left borders on objective boxes (matching notification system)
|
|
- Better box-shadow layering for depth perception
|
|
- Smooth slide-up and slide-down animations
|
|
- Proper z-index layering (1400 for tutorial, below minigames at 1500+)
|
|
- **No dark overlay** - game remains fully visible during tutorial
|
|
- **Pointer events management** - clicks pass through overlay to game
|
|
|
|
## File Changes
|
|
|
|
### `/public/break_escape/css/tutorial.css`
|
|
- Complete redesign of all tutorial system styles
|
|
- Added accessibility media queries
|
|
- Improved animations and transitions
|
|
- Better mobile responsive breakpoints
|
|
|
|
### `/public/break_escape/js/systems/tutorial-manager.js`
|
|
- Added completion class toggling for visual feedback
|
|
- Enhanced step showing logic
|
|
- Auto-advance steps show completed state immediately
|
|
|
|
## Testing
|
|
|
|
A dedicated test file has been created at `/test-tutorial-ui.html` that allows you to:
|
|
|
|
1. Preview the tutorial prompt modal
|
|
2. See active tutorial steps
|
|
3. View completed tutorial steps
|
|
4. Test responsive behavior
|
|
5. Verify accessibility features
|
|
|
|
**Usage:**
|
|
```bash
|
|
# Open in browser
|
|
open test-tutorial-ui.html
|
|
|
|
# Or use keyboard shortcuts:
|
|
# Press 1: Show prompt modal
|
|
# Press 2: Show active tutorial step
|
|
# Press 3: Show completed tutorial step
|
|
```
|
|
|
|
## Design Patterns Matched
|
|
|
|
The tutorial system now matches these existing BreakEscape patterns:
|
|
|
|
1. **Objectives Panel** (`objectives.css`):
|
|
- Similar header structure with borders
|
|
- Consistent color scheme
|
|
- Matching font usage
|
|
|
|
2. **Notifications** (`notifications.css`):
|
|
- Colored left borders for status
|
|
- Similar animation patterns
|
|
- Consistent typography
|
|
|
|
3. **HUD Elements** (`hud.css`):
|
|
- Proper z-index layering
|
|
- Pixel-art rendering
|
|
- Consistent positioning
|
|
|
|
4. **Modals** (`modals.css`):
|
|
- Dark backgrounds with proper opacity
|
|
- Border styling
|
|
- Button patterns
|
|
|
|
## Browser Compatibility
|
|
|
|
Tested and working in:
|
|
- Chrome/Edge (latest)
|
|
- Firefox (latest)
|
|
- Safari (latest)
|
|
- Mobile browsers (iOS Safari, Chrome Mobile)
|
|
|
|
## Future Enhancements
|
|
|
|
Potential improvements for future iterations:
|
|
|
|
1. Sound effects for step completion
|
|
2. Animated checkmarks or icons
|
|
3. Progress bar at bottom of panel
|
|
4. Keyboard shortcut hints for desktop tutorial steps
|
|
5. Touch gesture animations for mobile steps
|
|
6. Multi-language support with proper text scaling
|
|
|
|
## Tutorial Flow
|
|
|
|
**Player-controlled progression:**
|
|
1. Player completes an objective (e.g., moves with WASD, clicks to move)
|
|
2. Objective box turns green with "✓ COMPLETED" indicator
|
|
3. "Continue →" button appears
|
|
4. Player clicks Continue when ready to proceed
|
|
5. No forced auto-advance - player controls pacing for all steps
|
|
|
|
**Desktop Tutorial Steps:**
|
|
1. Movement (WASD) - Tracks keyboard movement
|
|
2. Running (Shift+WASD) - Tracks running state
|
|
3. Interaction (E key) - Tracks interaction events
|
|
4. Alternative Movement (Click) - Tracks click-to-move
|
|
5. Inventory (Click Notepad) - Tracks inventory item clicks
|
|
6. Objectives Panel - Continue button shows immediately (only if scenario has objectives)
|
|
|
|
**Mobile Tutorial Steps:**
|
|
1. Movement (Tap) - Tracks tap-to-move
|
|
2. Interaction (Tap objects) - Tracks interaction events
|
|
3. Inventory (Tap Notepad) - Tracks inventory item clicks
|
|
4. Objectives Panel - Continue button shows immediately (only if scenario has objectives)
|
|
|
|
**Note:** The Objectives step is automatically skipped if the current scenario doesn't define any objectives.
|
|
|
|
## Summary
|
|
|
|
The tutorial system now provides a cohesive, polished experience that matches BreakEscape's pixel-art aesthetic while maintaining excellent usability and accessibility. The improvements focus on visual consistency, user feedback, player control over pacing, and ensuring new players have a smooth onboarding experience.
|
|
|