- 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.
7.8 KiB
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
#444for standard borders,#00ff88for accented elements - Typography:
Press Start 2Pfor headers and titlesVT323for body text and instructions
- Accent color:
#00ff88(cyan-green) for primary actions and highlights - Secondary colors:
#4ade80for completion/success states#ff6b6bfor 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
::beforepseudo-elements - Consistent border styling with
#00ff88accent 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-pulseanimation) - Completion state with color change to green (
#4ade80) - Smooth transitions between states
JavaScript enhancements:
- Added
.completedclass 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
- Body text:
- 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-motionmedia query - Disables all animations and transforms when requested
- Respects
-
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
::beforepseudo-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:
- Preview the tutorial prompt modal
- See active tutorial steps
- View completed tutorial steps
- Test responsive behavior
- Verify accessibility features
Usage:
# 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:
-
Objectives Panel (
objectives.css):- Similar header structure with borders
- Consistent color scheme
- Matching font usage
-
Notifications (
notifications.css):- Colored left borders for status
- Similar animation patterns
- Consistent typography
-
HUD Elements (
hud.css):- Proper z-index layering
- Pixel-art rendering
- Consistent positioning
-
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:
- Sound effects for step completion
- Animated checkmarks or icons
- Progress bar at bottom of panel
- Keyboard shortcut hints for desktop tutorial steps
- Touch gesture animations for mobile steps
- Multi-language support with proper text scaling
Tutorial Flow
Player-controlled progression:
- Player completes an objective (e.g., moves with WASD, clicks to move)
- Objective box turns green with "✓ COMPLETED" indicator
- "Continue →" button appears
- Player clicks Continue when ready to proceed
- No forced auto-advance - player controls pacing for all steps
Desktop Tutorial Steps:
- Movement (WASD) - Tracks keyboard movement
- Running (Shift+WASD) - Tracks running state
- Interaction (E key) - Tracks interaction events
- Alternative Movement (Click) - Tracks click-to-move
- Inventory (Click Notepad) - Tracks inventory item clicks
- Objectives Panel - Continue button shows immediately (only if scenario has objectives)
Mobile Tutorial Steps:
- Movement (Tap) - Tracks tap-to-move
- Interaction (Tap objects) - Tracks interaction events
- Inventory (Tap Notepad) - Tracks inventory item clicks
- 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.