Communitygithub.com

evalix098/tiktoklive

브라우저 게임을 위한 플레이어 입력 조작 신호: WASD, 차량, 비행, FPS 마우스룩, 그리고 #1 실패 원인(반전된 A/D). 출시 전에 A가 왼쪽으로 회전하는지 확인할 수 있는 필수 컨트롤 자체 테스트와 작은 테스트 인터페이스를 제공합니다. 레이싱뿐만 아니라 움직임, 조향, 비행, 운전, 탱크, 보트, 메카, 드론, 비행기, 카트, 3인칭 추적 카메라가 있는 모든 게임에 로드하세요.

tiktoklive란 무엇인가요?

이 스킬은 WASD, 조향, 비행 제어를 구현하는 브라우저 게임에서 가장 흔한 실수인 반전된 A/D(왼쪽/오른쪽)를 방지하기 위한 명확한 규칙과 테스트 절차를 제공합니다. three.js 오른손 좌표계(+Y 업)를 기준으로 하여, 플레이어가 보는 왼쪽/오른쪽이 실제 게임 월드에서 올바르게 매핑되도록 강제합니다. FPS, 지상/수상 차량, 고정익 비행, 헬리콥터/드론, 2D 사이드스크롤러 등 장르별 매핑 테이블을 포함하며, 각 장르에서 A/D가 어떻게 동작해야 하는지 상세히 설명합니다. 또한 플레이어가 보는 방향과 입력이 일치하는지 확인하는 필수 자체 테스트(§5)를 제공하며, window.__controlsTest 프로브를 통해 개발 중 또는 QA 단계에서 자동화된 검증이 가능합니다. 이 스킬은 Claude Code, Cursor, Codex 등 모든 AI 에이전트에서 사용할 수 있으며, 건물 게임 스킬과 입력 레퍼런스 문서와 함께 사용하는 것이 좋습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/evalix098/tiktoklive/tree/HEAD/.grok/skills/controls

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

컨트롤 (플레이어에게 보이는 신호 — 반전된 상태로 출시하지 마세요)

움직임/조향/비행 코드를 작성하기 전에 이 문서를 처음부터 끝까지 읽으세요. WASD, 화살표, 추적 카메라 또는 비행체를 사용하는 모든 게임에 해당됩니다. 이 문서를 건너뛰고 racing-kart 또는 fps만 열지 마세요 — 해당 장르 파일은 이미 이 신호를 알고 있다고 가정합니다. 반전된 A/D는 차량 및 비행 데모에서 가장 흔한 출시 차단 요인입니다.

building-games (루프, 카메라, 3D 방향) 및 building-games/references/input.md (키다운 상태, 게임패드, 터치)와 함께 사용하세요. 이 스킬은 플레이어에게 왼쪽/오른쪽/위가 무엇을 의미하는지와 그것을 증명하는 방법에 대한 책임을 집니다.


0. 하드 규칙 (위반 시 빌드 실패)

  1. 플레이어가 보는 왼쪽/오른쪽이 법칙입니다. 추적 / 후방 카메라에서 비행체가 전진할 때:
    • A / ← → 기수(또는 기울임)가 화면상 왼쪽으로 회전
    • D / → → 기수(또는 기울임)가 화면상 오른쪽으로 회전
  2. FPS 스트레이프를 차량 조향으로 재사용하지 마세요. FPS의 "D → +오른쪽 벡터"는 지면 평면의 위치입니다. 차량 A/D는 요(또는 롤) 속도이지 스트레이프 오프셋이 아닙니다. 이 둘을 혼합하는 것이 반전된 A/D의 #1 원인입니다.
  3. 완료했다고 말하기 전에 반드시 컨트롤 자체 테스트(§5)를 실행해야 합니다. 스크린샷만으로는 QA가 충분하지 않습니다. A가 오른쪽으로 회전하면 조향/롤 부호를 뒤집고, 다시 테스트한 후 출시하세요. 새로운 좌표 체계를 발명하지 마세요.

1. 공통 3D 기반 (모든 곳에서 사용)

three.js: 오른손 좌표계, +Y 위, 메시가 +Z를 향함, 카메라는 -Z를 봄.

XZ 평면의 요 전용 방향 (지상 차량, 워커, 대부분의 아케이드 비행체):

// 요 = 0은 세계 -Z 방향; +요는 +Y 축 기준 시계 반대 방향(기수가 -X 쪽으로 이동)
전진 = (-sin(요), 0, -cos(요))
오른쪽 = ( cos(요), 0, -sin(요))   // = 정규화(외적(전진, 세계위쪽))

비행체 후방에 추적 카메라가 있는 경우 (카메라가 위치 - 전진 * 거리 근처):

플레이어가 봄세계 (이 기준)입력
기수가 왼쪽+요**A / ←**는 +요를 생성해야 함 (또는 비행기의 경우 왼쪽 기울임 동등)
기수가 오른쪽-요**D / →**는 -요를 생성해야 함

기반이 다르다면 하나의 일관된 쌍을 유지하세요. 하지만 위의 플레이어가 보는 행은 필수입니다.


2. 장르 매핑

2a. FPS / 보행 (스트레이프, 조향 아님)

W = +전진, S = -전진, D = +오른쪽, A = -오른쪽   // 요가 아닌 위치
마우스: 요 -= movementX * 감도; 피치 -= movementY * 감도; 피치 제한

바디 요는 보는 방향용; 움직임은 요만 사용합니다 (걷기에 피치를 적용하지 마세요).

2b. 지상 / 수상 차량 (카트, 자전거, 제트스키, 보트, 탱크, 로버, 스노모빌)

heading/yaw와 전진 speed를 가진 아케이드 바디:

// 입력 (누른 키 → 프레임당 한 번 동작)
let steer = 0; // -1..+1, 플레이어가 보는 대로
if (keys.has('KeyA') || keys.has('ArrowLeft'))  steer += 1;  // 왼쪽
if (keys.has('KeyD') || keys.has('ArrowRight')) steer -= 1;  // 오른쪽
// 선택 사항: steer = clamp(steer + gamepadX, -1, 1) 같은 부호 규칙 사용

// 통합 (speedFactor ~ 0..1, |speed|에서)
const reverse = speed >= 0 ? 1 : -1; // 후진 시에도 왼쪽 바퀴는 여전히 왼쪽으로 느껴짐
yaw += steer * turnRate * speedFactor * reverse * dt;

// 방향 따라 이동
const fx = -Math.sin(yaw), fz = -Math.cos(yaw);
position.x += fx * speed * dt;
position.z += fz * speed * dt;

표준 버그 (복사하지 마세요):

// 틀림 — 이것이 실제로 반전된 A/D를 출시하게 만드는 코드
if (KeyA) steer -= 1;
if (KeyD) steer += 1;
yaw += steer * turnRate * dt;  // A → -요 → 추적 카메라에서 기수가 오른쪽

이미 KeyA → steer--라고 작성했다면, 키 매핑을 바꾸거나 통합 시에 한 번 부호를 반전하세요(yaw += -steer * …) — 그리고 §5를 실행하세요. 두 번 뒤집지 마세요 (키 + 통합 + 메시 기울임).

2c. 고정익 비행 (비행기, 글라이더, RC 비행기)

입력동작플레이어 기대
A / ←왼쪽 롤 (에일러론)왼쪽 날개 아래 / 왼쪽 기울임
D / →오른쪽 롤오른쪽 날개 아래 / 오른쪽 기울임
W / ↑피치 (하나의 방식을 선택하고 HUD에 표시)일반적으로 기수 내림 또는 당기기 — 일관성 유지
S / ↓반대 피치
Q / E요 / 러더 (선택 사항)Q는 왼쪽, E는 오른쪽
  • A/D는 스트레이프가 아니며 "FPS 신호로 지상 조향"도 아닙니다.
  • 비행체의 로컬 전진 축에 롤을 적용하고, A에서 왼쪽 기울임에 해당하는 부호를 사용하세요. 메시가 잘못된 방향으로 기울면, 전체 기준이 아닌 롤 적용(또는 A/D → 롤 매핑)에서 하나의 부호를 뒤집으세요.
  • 조정된 회전: 양의 기울기는 추적/외부 카메라 아래에서 기울기 방향과 일치하는 회전을 생성해야 합니다.

2d. 헬리콥터 / 드론 / 6DOF

시작 화면 오버레이에 방식을 문서화하세요. 최소:

  • 개별 키의 스로틀/고도는 한 번 누른 후 "항상 위"로 고정되지 않아야 함 (누름 상태 또는 명시적인 위/아래 사용).
  • 스트레이프/요: 비행체의 수평 프레임에서 A는 왼쪽, D는 오른쪽 (플레이어가 볼 수 있게).

2e. 2D 사이드스크롤러 / 플랫포머

**D / →**는 화면상 오른쪽으로 이동, **A / ←**는 화면상 왼쪽으로 이동. 장르가 명시적으로 거꾸로 되어 있지 않다면 중력만 반전됩니다.


3. 카메라는 일치해야 함

  • 추적 카메라: desired = craftPos + up*height + forward*(-followDist); lerp; lookAt(craft).
  • 한 번 forward를 계산하여 움직임과 카메라 모두에 사용하세요 — 카메라 경로에서 반대 요 부호로 다시 만들지 마세요.
  • 디버그 순서: (1) 키 등록 → (2) 부호 올바름(§5) → (3) 카메라 일치.

4. 입력 파이프라인 (간략)

  • 키는 keydown/keyup에서 **event.code**를 사용하여 Set으로 추적; blur / visibilitychange에서 초기화. 게임 루프에서 dt로 이동, 키 핸들러 내부가 아님.
  • 키보드 + 터치 + 게임패드를 액션(throttle, steer, pitch, roll, …)으로 통일. building-games/references/input.md 참조.
  • 터치: 왼쪽 스틱 = 이동/조향, 오른쪽 = 액션; ≥44px 타겟.

5. 필수 컨트롤 자체 테스트 ("완료" 전)

A/D가 있는 모든 비행체에 대해 스크린샷만으로는 충분하지 않습니다.

5a. 플레이어 가시 체크리스트 (모든 차량 / 비행 빌드)

전진하는 동안 (속도 > 작은 엡실론), 후방 추적 카메라:

누르기~0.5초 이내에 관찰해야 함
A기수 또는 기울임이 화면상 왼쪽으로 이동
D기수 또는 기울임이 화면상 오른쪽으로 이동
W (지상)속도 증가 / 향하는 방향으로 이동
S (지상)제동 또는 후진 (설계된 대로)

A가 실패하면: 조향/롤 부호를 한 번 뒤집고, A와 D를 모두 다시 테스트하세요.

5b. 최소 테스트 인터페이스 (구현하세요)

비공개 클로저를 추측하지 않고 부호를 증명할 수 있도록 작은 훅을 노출하세요.

// 예: src/game/controlsTest.ts — 개발/QA 전용 괜찮음
export type ControlsProbe = {
  getYaw: () => number;       // 라디안; 또는 getHeading()
  getSpeed: () => number;
  /** 실제 키 대신 누른 액션을 주입; 둘 다 변경할 때까지 적용된 상태로 유지되므로
   *  §5c가 여러 프레임에 걸쳐 키를 누르고 마지막에 해제할 수 있음 */
  setSteer?: (v: number) => void; // -1..1, 프로덕션과 동일한 부호
  setKeys?: (codes: string[]) => void; // 다음 호출까지 유지; `[]`는 해제
};

declare global {
  interface Window {
    __controlsTest?: ControlsProbe;
  }
}

import.meta.env.DEV 또는 ?qa=1 플래그가 설정된 경우 게임 루프에서 window.__controlsTest를 연결하세요.

5c. 자동화된 스모크 테스트 (실행하세요)

§5b 프로브를 사전 설치된 agent-browser CLI로 구동하세요 — 수동 스크립트가 아닌 첫 번째 동작입니다. eval이 던지면 0이 아닌 종료 코드, 단순히 거짓이면 0이 아닌 종료 코드를 발생하지 않음으로, 어설션은 던져서 하세요. 하나의 batch로 실행하세요 — 각 동사당 하나씩이 아니라 하나의 CLI 호출 — stdin에서 JSON을 받음; --bail은 첫 번째 실패 단계에서 멈추고 0이 아닌 종료 코드를 반환합니다.

agent-browser batch --bail <<'JSON'   # find의 label은 대소문자 구분: `snapshot -i`에서 복사
[["open","http://127.0.0.1:8080/"],
 ["find","text","Start","click"],
 ["eval","if (!window.__controlsTest?.setKeys) throw Error('no §5b probe: add setKeys')"],
 ["eval","__controlsTest.setKeys(['KeyW'])"],
 ["wait","600"],
 ["eval","if (__controlsTest.getSpeed() <= 0.1) throw Error('W: no move')"],
 ["eval","(async () => { const t = __controlsTest, y0 = t.getYaw(); t.setKeys(['KeyW','KeyA']); await new Promise(r => setTimeout(r, 300)); t.setKeys(['KeyW']); const d = t.getYaw() - y0, w = Math.atan2(Math.sin(d), Math.cos(d)); if (w < -0.05) throw Error('A turns RIGHT — inverted, got ' + w.toFixed(2)); if (w <= 0.05) throw Error('A barely turned (' + w.toFixed(2) + ') — hold longer or check the sim is running'); return 'A ok' })()"],
 ["eval","__controlsTest.setKeys([])"],
 ["screenshot","/workspace/screenshots/controls.png"],
 ["close"]]
JSON

keydown이 아닌 프로브를 통해 키를 누르세요 — agent-browser keydown은 §4의 Set에 도달하지 않으므로 올바른 게임이 깨진 것으로 읽힙니다. 프로브에 setKeys가 없습니까? 추가하거나(§5b) 직접 키 이벤트를 디스패치하세요 — 브라우저 QA 참조의 Keys 노트에 메커니즘과 형식이 있습니다.

누름은 하나의 eval 내부에 있습니다: 여러 명령에 걸쳐 확산되면 명령이 실행되는 시간만큼 지속되며, Math.atan2(Math.sin(d), Math.cos(d))의 ±π 래핑은 π 이상 회전한 비행체를 반대 방향으로 회전한 것으로 읽습니다. IIFE는 단계를 재실행 가능하게 유지하는 것 — 베어 const d = …는 두 번째에 "이미 선언됨"으로 실패 — async는 페이지 시간 내에 누름이 실행되도록 합니다. D에 대해 'KeyD'와 두 비교를 반전(w > 0.05는 반전, w >= -0.05는 거의 회전하지 않음)하여 반복, 작은따옴표로 묶어 JSON에 이스케이프가 필요 없게 함; 비행기의 경우 롤을 어설션: A ⇒ 왼쪽 기울임.

**A turns RIGHT**는 부호 오류입니다: 하나의 부호를 뒤집고 다시 실행하세요. **A barely turned**는 그렇지 않습니다 — 비행체가 올바른 방향으로 움직였지만 300ms 동안 0.05라디안 미만으로, 보트나 무거운 로버는 그럴 수 있습니다; 누름 시간을 늘리거나 시뮬레이션이 실행 중인지 확인하고, 아무것도 뒤집지 마세요. 다른 0이 아닌 종료 — 프로브 없음, 멈춘 데몬 — 검사가 실행되지 않았음을 의미합니다: 먼저 메시지를 읽으세요. 첫 번째 흐름 전에 브라우저 QA 참조 AGENTS.md 링크를 읽으세요 — 동사, 인수 형태 및 대체 방법이 있습니다.

5d. 하지 말아야 할 것

  • "D가 어떤 내부 변수를 증가시킨다"만 테스트하지 마세요.
  • 차량 통과 조건으로 FPS "D → -Z를 향할 때 +X"를 사용하지 마세요.
  • 수정 시 메시 기울임, 카메라 및 조향을 동시에 모두 뒤집지 마세요 — 하나의 부호를 변경하고 다시 테스트하세요.

6. 완료 기준 (컨트롤)

  • 움직임/조향/비행 코드를 작성하기 전에 이 스킬을 열었습니다.
  • 장르 매핑을 선택했으며(§2) 시작 화면 / HUD 레이블이 일치합니다.
  • 추적 카메라 A/D 플레이어 가시 테스트 통과(§5a).
  • window.__controlsTest (또는 동등)가 개발/QA에서 사용 가능하며 한 번 사용되었습니다.
  • 롤/조향 입력에 비해 반전된 기울임 메시가 없습니다.
  • 키는 누름 상태 + dt 스케일링됨; 의도적이지 않고 레이블이 없는 한 단일 Space 탭으로 추력이 고정되지 않습니다.

하나라도 체크되지 않으면 게임은 완료되지 않았습니다.

Individual skills in this repo

This repo contains 17 individual skills — each has its own dedicated page.

evalix098/tiktoklive

Add user accounts and sign-in to this TanStack Start app. Use when the app needs authentication, sign-in, user accounts, protected routes, or per-user data. Triggers on "auth", "login", "log in", "sign in", "sign up", "account", "users", "authentication", "protected", "who is logged in", "current user", "per-user".

evalix098/tiktoklive

Build browser games and interactive/canvas/3D experiences in this TanStack Start + React app. Use for any game, simulation, or WebGL/Canvas experience — 2D or 3D, single-player. Covers the game loop & timing, 3D orientation/camera conventions, collision, performance, assets, audio, save, game feel, and per-genre playbooks. For WASD / vehicle / flight **input signs and inverted A/D**, open the **`controls`** skill — do not rely on this file or racing-kart alone. Triggers on "game", "minecraft", "fps", "platformer", "racing", "tetris", "snake", "shooter", "3d", "three.js", "canvas", "voxel", "physics".

evalix098/tiktoklive

Design and build polished, non-generic UI for this TanStack Start + React + Tailwind v4 + shadcn/Radix app. Use whenever you create or restyle any interface surface — pages, landing pages, dashboards, forms, modals, nav, and game overlays (start screens, HUD, menus). Covers design tokens, layout, typography, color, spacing, motion, and the anti-"AI-slop" rules that keep output from looking generic. Triggers on "design", "UI", "make it look good", "polish", "landing page", "theme", "style", "redesign", "ugly", "clean up".

evalix098/tiktoklive

Deep guide for game ANIMATION assets: motion cycles, action keyframes, effect sequences, and animation sprite sheets — built around a video-first pipeline. In this app-builder sandbox, execute via the video2dsprite / generate2dsprite skills (magenta + scripts), not ad-hoc ffmpeg. Use whenever generating anything that moves: walk/run cycles, attacks, idles, FX, flags, fire, animation sheets. Complements game-asset-core.

evalix098/tiktoklive

Core discipline for ANY game-asset generation with Imagine tools: the engine-ready defaults users don't state, spec checklists, style anchoring, read-back verification, honest defect flagging. Use whenever generating any game art (sprites, sheets, animations, tiles, UI, FX) — then ALSO load the matching specialist skill: game-animation-frames for anything that moves, game-tilesets for tiles/terrain, game-character-consistency for recurring characters, game-ui-icons for UI and icons.

evalix098/tiktoklive

Deep guide for CHARACTER IDENTITY across images: turnarounds (front/side/ back), state and damage variants, palette swaps, equipment changes, and same-character-in-context sets. Use whenever generating character turnarounds, character sheets, variants of an existing sprite, or any same-subject multi-image set. Complements game-asset-core.

evalix098/tiktoklive

Deep guide for game TILE assets: seamless tileable textures, terrain transition tilesets, autotiles, and ground/platform tiles. Use whenever generating tileable textures, tilesets, terrain transitions, or seamless patterns. Complements game-asset-core.

evalix098/tiktoklive

Deep guide for game UI assets: buttons with interaction states, panels, bars, wordmark logos, and icon sets. Use whenever generating game UI elements, HUD assets, inventory icons, icon sets, buttons, or title logos. Complements game-asset-core.

evalix098/tiktoklive

Generate production-oriented 2D game maps with `imagine_text_to_image`: RPG/top-down maps, side-scroller parallax stages, tilemaps, layered raster maps, prop packs, collision zones, and walkable areas. Use when building browser games that need real map art (not pure code-drawn tiles), layered props, or map collision metadata. Triggers on "map", "level", "stage", "tilemap", "overworld", "dungeon", "side scroller background", "prop pack", "2D map".

evalix098/tiktoklive

Generate and postprocess 2D game sprites and animation sheets: pixel-art characters, NPCs, creatures, spells, projectiles, impacts, props, summons, and transparent PNG/GIF exports. Use when building browser games that need real sprite sheets (not code-drawn placeholders), matching a map art style, or producing magenta-background sheets for chroma-key cleanup. Triggers on "sprite", "sprite sheet", "animation sheet", "pixel art character", "walk cycle", "attack animation", "projectile sprite", "2D game asset".

evalix098/tiktoklive

How to use the Imagine tools in Grok Build: imagine_text_to_image, imagine_image_to_image, imagine_reference_to_image, imagine_text_to_video, imagine_image_to_video, imagine_reference_to_video, and render_file for chat previews. When to build a visual with code instead of generating it, prompt-craft, reference-first handling of real people, factual grounding, and asset-consistency. Load this whenever generating or editing an image or video is on the table. Tool-usage-driven, not triggered by a user merely mentioning images.

evalix098/tiktoklive

Peer-to-peer realtime multiplayer over WebRTC data channels: every user of the deployed app connects directly to every other user (full mesh), the server only brokers the handshake at /api/rtc. Lowest possible latency, zero per-message server cost. Use for 2-8 player co-op/casual realtime: shared cursors, drawing, party games, casual action. Triggers: p2p, peer to peer, webrtc, low latency multiplayer, direct connection.

evalix098/tiktoklive

Use Neon Postgres (the database) in this TanStack Start app. Use when the app needs to store or query data, persist state, or keep per-user data. Triggers on "database", "Postgres", "Neon", "save data", "store data", "persist", "tables", "SQL", "query", "migrations".

evalix098/tiktoklive

Share-link previews and app identity for apps on *.grok.me: the injector-owned og:image card, the SVG favicon, and PWA icons for installable apps. Use when scaffolding, renaming, or restyling the app — and for share / unfurl / OG / Twitter card questions. A custom 1200×630 card from the app's own art is the default — games of every kind (DOM board/word games included), whimsical apps, creative tools, and brand-forward pages; only plain utilities keep the placeholder. Always run the brand-asset pass as a `task` subagent and never wait for it. Triggers on "share", "rename", "app name", "OG", "Open Graph", "twitter card", "unfurl", "og:image", "og:type", "x:game:image", "x-banner", "link preview", "social card", "thumbnail", "preview image", "favicon", "app icon", "PWA", "manifest", "installable", "home screen", "SEO", "meta description".

evalix098/tiktoklive

Official Three.js API and TSL (Three.js Shading Language) reference for LLM code generation. Load when writing or debugging three.js / WebGL / WebGPU / custom materials / shaders / GLTF / advanced three APIs beyond basic game loop/controls. Prefer building-games for game correctness (loop, WASD, camera, orientation); use this skill for full API/TSL depth. Triggers on "three.js", "threejs", "WebGPU", "TSL", "NodeMaterial", "shader", "GLTF", "MeshStandard", "OrbitControls", "WebGLRenderer".

evalix098/tiktoklive

Grok Build only. Turn a 2D character still into denser animation sprites via imagine_text_to_image base → imagine_image_to_video (6s/10s run-in-place) → ffmpeg frames → magenta chroma-key → dense sampled strips/grids/GIFs. Use when the user wants video-to-sprite, smoother run/walk cycles, or denser intermediate poses. Prefer generate2dsprite for crisp production pixel sheets. Triggers on "video to sprite", "imagine_image_to_video sprite", "dense walk cycle", "smooth run animation from video".

evalix098/tiktoklive

Call the xAI API (Grok) from this app's server code using the injected XAI_API_KEY: chat/LLM features, image and video generation (Imagine), and voice (text-to-speech). Use when the app needs any "AI" / "assistant" / "chatbot" / "Grok" functionality, runtime image/video generation, or speech. Triggers on "AI", "LLM", "chatbot", "assistant", "Grok", "xAI", "generate text", "summarize", "generate image", "AI video", "voice", "text to speech", "TTS", "OpenAI" (use xAI instead).

관련 스킬