Completed multi-platform expansion with Spatial Creator Toolkit support, bringing total platforms to 3 active (Roblox, UEFN, Spatial). New File: src/lib/templates-spatial.ts - 10 production-ready Spatial TypeScript templates - Categories: Beginner (2), Gameplay (4), UI (2), Tools (1), Advanced (1) Templates include: 1. hello-world - Basic Spatial SDK usage 2. player-tracker - Player join/leave events 3. object-interaction - Click handlers and 3D object interaction 4. countdown-timer - Timer with UI updates 5. score-tracker - Score management with leaderboards 6. trigger-zone - Spatial trigger zones for area detection 7. object-spawner - Spawning objects at intervals 8. teleporter - Teleportation system with pads 9. animation-controller - Advanced object animations 10. voice-zone - Proximity-based voice chat areas Updated: src/lib/templates.ts - Import spatialTemplates - Add to combined templates export - Total templates now: 43 (25 Roblox + 8 UEFN + 10 Spatial) Updated: src/lib/platforms.ts - Changed Spatial status from 'coming-soon' to 'beta' - Spatial now appears in platform selector - activePlatforms now includes Spatial Impact: ✅ 3 platforms now active (Roblox, UEFN, Spatial) ✅ Users can switch to Spatial and see 10 templates ✅ TypeScript syntax highlighting in editor ✅ Translation Roblox ↔ Spatial ready ✅ Translation UEFN ↔ Spatial ready ✅ 43 total templates across all platforms Strategic Achievement: - Multi-platform vision expanded - VR/AR platform support added - Cross-platform translation covers more pairs - Competitive advantage strengthened
90 lines
2.2 KiB
TypeScript
90 lines
2.2 KiB
TypeScript
/**
|
|
* Platform Abstraction Layer
|
|
* Supports: Roblox, UEFN, Spatial, Core
|
|
*/
|
|
|
|
export type PlatformId = 'roblox' | 'uefn' | 'spatial' | 'core';
|
|
|
|
export interface Platform {
|
|
id: PlatformId;
|
|
name: string;
|
|
displayName: string;
|
|
language: string;
|
|
fileExtension: string;
|
|
description: string;
|
|
color: string;
|
|
icon: string;
|
|
apiDocs: string;
|
|
status: 'active' | 'beta' | 'coming-soon';
|
|
}
|
|
|
|
export const platforms: Record<PlatformId, Platform> = {
|
|
roblox: {
|
|
id: 'roblox',
|
|
name: 'Roblox',
|
|
displayName: 'Roblox Studio',
|
|
language: 'Lua 5.1',
|
|
fileExtension: '.lua',
|
|
description: 'Build immersive 3D experiences on Roblox',
|
|
color: '#00A2FF',
|
|
icon: '🎮',
|
|
apiDocs: 'https://create.roblox.com/docs',
|
|
status: 'active',
|
|
},
|
|
uefn: {
|
|
id: 'uefn',
|
|
name: 'UEFN',
|
|
displayName: 'Unreal Editor for Fortnite',
|
|
language: 'Verse',
|
|
fileExtension: '.verse',
|
|
description: 'Create Fortnite experiences with Verse',
|
|
color: '#0E86D4',
|
|
icon: '⚡',
|
|
apiDocs: 'https://dev.epicgames.com/documentation/en-us/uefn',
|
|
status: 'beta',
|
|
},
|
|
spatial: {
|
|
id: 'spatial',
|
|
name: 'Spatial',
|
|
displayName: 'Spatial Creator Toolkit',
|
|
language: 'TypeScript',
|
|
fileExtension: '.ts',
|
|
description: 'Build VR/AR experiences for Spatial',
|
|
color: '#FF6B6B',
|
|
icon: '🌐',
|
|
apiDocs: 'https://toolkit.spatial.io/docs',
|
|
status: 'beta',
|
|
},
|
|
core: {
|
|
id: 'core',
|
|
name: 'Core',
|
|
displayName: 'Core Games',
|
|
language: 'Lua 5.3',
|
|
fileExtension: '.lua',
|
|
description: 'Develop multiplayer games on Core',
|
|
color: '#FF4655',
|
|
icon: '🎯',
|
|
apiDocs: 'https://docs.coregames.com',
|
|
status: 'coming-soon',
|
|
},
|
|
};
|
|
|
|
export const activePlatforms = Object.values(platforms).filter(
|
|
(p) => p.status === 'active' || p.status === 'beta'
|
|
);
|
|
|
|
export function getPlatform(id: PlatformId): Platform {
|
|
return platforms[id];
|
|
}
|
|
|
|
export function isPlatformActive(id: PlatformId): boolean {
|
|
return platforms[id].status === 'active';
|
|
}
|
|
|
|
export function getLanguageForPlatform(id: PlatformId): string {
|
|
return platforms[id].language;
|
|
}
|
|
|
|
export function getFileExtensionForPlatform(id: PlatformId): string {
|
|
return platforms[id].fileExtension;
|
|
}
|