mobile-game-controls

仓库创建 2026年7月27日最近提交 22 小时前SkillHot 收录 17 小时前
这个 Skill 做什么

给网页游戏做手机触控适配,包含虚拟手柄、多点触控、CSS 触摸检测和 iOS/Android 部署的常见坑位。推荐把触控和键盘并存(不要替换),常用于 p5.js、Canvas 或 HTML5 游戏上手机和平板时的输入方案。特点是实战导向的控件和多指识别,能减少平台兼容问题。

▸ 展开 SKILL.md 英文原文

Touch controls and mobile deployment for browser-based games and interactive p5.js projects. Covers on-screen virtual gamepads, multi-touch handling, CSS touch detection, and iOS/Android deployment pitfalls.

0
Stars
0
Forks
40
仓库内 Skill
积累中
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/trojan-lord/hermes-cuso/main/skills/mobile-game-controls/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/trojan-lord/hermes-cuso/main/skills/mobile-game-controls/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# Mobile Game Controls — Touch Interfaces for Browser Games

## When to use

Any interactive browser project (p5.js games, canvas apps, HTML5 games) that needs to work on phones/tablets alongside desktop keyboard controls. Covers on-screen virtual gamepads, multi-touch, and mobile deployment.

## Core principle

Add touch controls ALONGSIDE keyboard controls. Don't replace. The `keysHeld` pattern used for keyboard input should be the shared state layer — touch buttons write to the same object.

## CSS — touch device detection

```css
@media (hover: none) and (pointer: coarse) {
  #touch-controls { display: block; }
}
```

This is the reliable CSS media query for touch-only devices. Shows but
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有