home / skills / bbeierle12 / skill-mcp-claude / platform-building

platform-building skill

/skills/platform-building

This skill helps you implement cross-platform building controls for mobile, VR, and accessibility, improving input adaptation and inclusive design patterns.

npx playbooks add skill bbeierle12/skill-mcp-claude --skill platform-building

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
3.4 KB
---
name: platform-building
description: Platform-specific building systems for mobile, VR, and accessibility. Use when implementing touch controls for building games, VR spatial input, colorblind-friendly feedback, or cross-platform building mechanics. Covers input adaptation and inclusive design patterns.
---

# Platform Building

Touch controls, VR input, and accessibility patterns for building systems.

## Quick Start

```javascript
import { TouchBuildController } from './scripts/touch-build-controller.js';
import { VRBuildingAdapter } from './scripts/vr-building-adapter.js';
import { AccessibilityConfig } from './scripts/accessibility-config.js';

// Mobile touch building
const touch = new TouchBuildController(canvas, {
  doubleTapToPlace: true,
  pinchToRotate: true,
  swipeToChangePiece: true
});

touch.onPlace = (position, rotation) => buildingSystem.place(position, rotation);
touch.onRotate = (angle) => ghost.rotate(angle);

// VR building with hand tracking
const vr = new VRBuildingAdapter(xrSession, {
  dominantHand: 'right',
  snapToGrid: true,
  comfortMode: true // Reduces motion sickness
});

vr.onGrab = (piece) => selection.select(piece);
vr.onRelease = (position) => buildingSystem.place(position);

// Accessibility configuration
const a11y = new AccessibilityConfig({
  colorblindMode: 'deuteranopia', // red-green
  highContrast: true,
  screenReaderHints: true
});

// Apply to ghost preview
ghost.setColors(a11y.getValidityColors());
```

## Reference

See `references/platform-considerations.md` for:
- Mobile gesture patterns (Fortnite Mobile, Minecraft PE)
- VR building research and comfort guidelines
- Colorblind palette recommendations
- Screen reader integration patterns
- Cross-platform input abstraction

## Scripts

| File | Lines | Purpose |
|------|-------|---------|
| `touch-build-controller.js` | ~450 | Mobile gestures: tap, drag, pinch, swipe |
| `vr-building-adapter.js` | ~400 | VR hand/controller input, comfort settings |
| `accessibility-config.js` | ~350 | Colorblind modes, contrast, screen reader |

## Platform Detection

```javascript
// Detect platform capabilities
const platform = {
  isMobile: /Android|iPhone|iPad|iPod/i.test(navigator.userAgent),
  isTouch: 'ontouchstart' in window,
  isVR: navigator.xr !== undefined,
  prefersReducedMotion: window.matchMedia('(prefers-reduced-motion: reduce)').matches,
  prefersHighContrast: window.matchMedia('(prefers-contrast: more)').matches
};

// Initialize appropriate controllers
if (platform.isVR && xrSession) {
  setupVRControls();
} else if (platform.isTouch) {
  setupTouchControls();
} else {
  setupMouseKeyboard();
}
```

## Mobile Considerations

Fortnite Mobile demonstrates effective touch building with customizable HUD, auto-material selection, and gesture-based piece rotation. Key patterns include dedicated build mode toggle, large touch targets (minimum 44px), and visual feedback for all actions.

## VR Considerations

VR building requires attention to comfort. Snap rotation reduces motion sickness, and arm-length building distances prevent fatigue. Hand tracking enables intuitive grab-and-place, while controller building benefits from laser-pointer selection for distant pieces.

## Accessibility Patterns

Valheim uses blue/yellow instead of green/red for stability indicators, supporting deuteranopia (the most common colorblind condition). High contrast modes should use 7:1 ratio for critical indicators, and all visual feedback should have audio/haptic alternatives.

Overview

This skill provides platform-specific building systems for mobile, VR, and accessibility-aware games. It bundles input adapters and configuration patterns to implement touch gestures, VR spatial input, and inclusive feedback. Use it to unify building mechanics across devices while preserving comfort and accessibility.

How this skill works

The skill exposes controllers and adapters for touch, VR, and accessibility settings that map raw input to building actions like place, rotate, and select. It detects platform capabilities and initializes the appropriate input pipeline (touch, XR, or mouse/keyboard), and supplies color/contrast and audio/haptic alternatives for UI feedback. Developers plug callbacks (onPlace, onRotate, onGrab, onRelease) into their existing building system to drive placement and previews.

When to use it

  • Implementing touch-first building controls for mobile games and tablets.
  • Adding hand-tracking or controller-based placement in VR experiences.
  • Designing colorblind-friendly and high-contrast feedback for building UIs.
  • Creating cross-platform building logic that shares core rules but adapts input.
  • Reducing motion-sickness and fatigue with comfort-focused VR settings.

Best practices

  • Detect platform capabilities early and instantiate only the relevant controller.
  • Provide large, well-spaced touch targets (≥44px) and a dedicated build mode toggle on mobile.
  • Offer alternative cues: audio, haptics, and textual hints for visual indicators.
  • Use color palettes that support deuteranopia and maintain at least 7:1 contrast for critical states.
  • In VR, prefer snap-to-grid/snap-rotation and limit reach distance to arm length to reduce fatigue.

Example use cases

  • Mobile: pinch to rotate a ghost preview, double-tap to place, swipe to cycle pieces.
  • VR: hand-tracked grab for local placement and laser-pointer for distant selection with comfort snap.
  • Accessibility: switch to deuteranopia palette and enable screen reader hints for building validation.
  • Cross-platform: single building rule set with separate input adapters for touch, XR, and keyboard/mouse.

FAQ

How do I choose between snap and free rotation in VR?

Use snap rotation for comfort-sensitive scenarios and optional free rotation for precision tasks; allow the player to toggle.

What size should touch targets be?

Aim for a minimum of 44px touch targets and generous spacing to reduce mis-taps on mobile.