@vibes.diy/prompts 14.3.249 → 14.3.251
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generation-variety.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/llms/backend.js +1 -0
- package/llms/backend.js.map +1 -1
- package/llms/blockly.js +1 -0
- package/llms/blockly.js.map +1 -1
- package/llms/blockly.md +2 -3
- package/llms/bluesky.js +2 -0
- package/llms/bluesky.js.map +1 -1
- package/llms/board-games.js +9 -4
- package/llms/board-games.js.map +1 -1
- package/llms/board-games.md +3 -153
- package/llms/callai.js +1 -0
- package/llms/callai.js.map +1 -1
- package/llms/callai.md +1 -1
- package/llms/canvas-theme-colors.d.ts +2 -0
- package/llms/canvas-theme-colors.js +7 -0
- package/llms/canvas-theme-colors.js.map +1 -0
- package/llms/canvas-theme-colors.md +70 -0
- package/llms/image-gen.js +1 -0
- package/llms/image-gen.js.map +1 -1
- package/llms/image-gen.md +1 -1
- package/llms/index.d.ts +24 -2
- package/llms/index.js +64 -0
- package/llms/index.js.map +1 -1
- package/llms/keepsake.d.ts +2 -0
- package/llms/keepsake.js +9 -0
- package/llms/keepsake.js.map +1 -0
- package/llms/keepsake.md +74 -0
- package/llms/live-rooms.d.ts +2 -0
- package/llms/live-rooms.js +28 -0
- package/llms/live-rooms.js.map +1 -0
- package/llms/live-rooms.md +288 -0
- package/llms/media-capture.d.ts +2 -0
- package/llms/media-capture.js +27 -0
- package/llms/media-capture.js.map +1 -0
- package/llms/media-capture.md +190 -0
- package/llms/mic-capture.d.ts +2 -0
- package/llms/mic-capture.js +7 -0
- package/llms/mic-capture.js.map +1 -0
- package/llms/mic-capture.md +76 -0
- package/llms/needs.d.ts +12 -0
- package/llms/needs.js +71 -0
- package/llms/needs.js.map +1 -0
- package/llms/owner-secret.d.ts +2 -0
- package/llms/owner-secret.js +8 -0
- package/llms/owner-secret.js.map +1 -0
- package/llms/owner-secret.md +82 -0
- package/llms/p5.js +1 -0
- package/llms/p5.js.map +1 -1
- package/llms/p5.md +15 -69
- package/llms/photo-input.d.ts +2 -0
- package/llms/photo-input.js +7 -0
- package/llms/photo-input.js.map +1 -0
- package/llms/photo-input.md +141 -0
- package/llms/physics.js +1 -0
- package/llms/physics.js.map +1 -1
- package/llms/physics.md +7 -16
- package/llms/reskin.js +3 -8
- package/llms/reskin.js.map +1 -1
- package/llms/reskin.md +12 -78
- package/llms/richtext.md +2 -0
- package/llms/social-post.js +1 -0
- package/llms/social-post.js.map +1 -1
- package/llms/social-post.md +22 -4
- package/llms/sound-core.d.ts +2 -0
- package/llms/sound-core.js +7 -0
- package/llms/sound-core.js.map +1 -0
- package/llms/sound-core.md +131 -0
- package/llms/spotify.js +11 -1
- package/llms/spotify.js.map +1 -1
- package/llms/spotify.md +54 -50
- package/llms/strudel.js +2 -0
- package/llms/strudel.js.map +1 -1
- package/llms/strudel.md +24 -25
- package/llms/surface-board.d.ts +2 -0
- package/llms/surface-board.js +8 -0
- package/llms/surface-board.js.map +1 -0
- package/llms/surface-board.md +140 -0
- package/llms/surface-play-area.d.ts +2 -0
- package/llms/surface-play-area.js +8 -0
- package/llms/surface-play-area.js.map +1 -0
- package/llms/surface-play-area.md +51 -0
- package/llms/surface-presence.d.ts +2 -0
- package/llms/surface-presence.js +9 -0
- package/llms/surface-presence.js.map +1 -0
- package/llms/surface-presence.md +118 -0
- package/llms/third-party-embed.d.ts +2 -0
- package/llms/third-party-embed.js +8 -0
- package/llms/third-party-embed.js.map +1 -0
- package/llms/third-party-embed.md +110 -0
- package/llms/three-js.js +1 -1
- package/llms/three-js.js.map +1 -1
- package/llms/three-js.md +52 -18
- package/llms/touch-games.js +11 -11
- package/llms/touch-games.js.map +1 -1
- package/llms/touch-games.md +59 -354
- package/llms/types.d.ts +14 -0
- package/llms/ui-chat.js +2 -1
- package/llms/ui-chat.js.map +1 -1
- package/llms/ui-chat.md +25 -14
- package/llms/ui-weather.js +1 -1
- package/llms/ui-weather.js.map +1 -1
- package/llms/ui-weather.md +1 -2
- package/llms/use-vibe.js +1 -0
- package/llms/use-vibe.js.map +1 -1
- package/llms/use-viewer.js +1 -0
- package/llms/use-viewer.js.map +1 -1
- package/llms/voxel.js +1 -0
- package/llms/voxel.js.map +1 -1
- package/llms/voxel.md +33 -109
- package/llms/weather.d.ts +2 -0
- package/llms/weather.js +12 -0
- package/llms/weather.js.map +1 -0
- package/llms/weather.md +248 -0
- package/llms/web-audio.js +4 -21
- package/llms/web-audio.js.map +1 -1
- package/llms/web-audio.md +19 -951
- package/llms/web-music.d.ts +2 -0
- package/llms/web-music.js +8 -0
- package/llms/web-music.js.map +1 -0
- package/llms/web-music.md +895 -0
- package/llms/world-controls.d.ts +2 -0
- package/llms/world-controls.js +14 -0
- package/llms/world-controls.js.map +1 -0
- package/llms/world-controls.md +262 -0
- package/llms/worlds.js +2 -1
- package/llms/worlds.js.map +1 -1
- package/llms/worlds.md +5 -14
- package/llms/youtube.js +10 -1
- package/llms/youtube.js.map +1 -1
- package/llms/youtube.md +67 -53
- package/package.json +5 -5
- package/prompts.js +5 -19
- package/prompts.js.map +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const thirdPartyEmbedConfig = {
|
|
2
|
+
name: "third-party-embed",
|
|
3
|
+
label: "Third-party embeds",
|
|
4
|
+
description: "Hidden: another site's player inside the page — store the pasted link and build the iframe src from its parsed id, one EmbedFrame with title, lazy loading and the allow tokens the vibe's frame delegates, a link out under every player, a press-to-load card for long lists, and keyless oEmbed titles and thumbnails",
|
|
5
|
+
menu: false,
|
|
6
|
+
teaches: ["oEmbed"],
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=third-party-embed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"third-party-embed.js","sourceRoot":"","sources":["../../jsr/llms/third-party-embed.ts"],"names":[],"mappings":"AAOA,MAAM,CAAC,MAAM,qBAAqB,GAAc;IAC9C,IAAI,EAAE,mBAAmB;IACzB,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,0TAA0T;IAC5T,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,CAAC,QAAQ,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Third-party embeds — another site's player inside the page
|
|
2
|
+
|
|
3
|
+
A video, a track, a playlist from another site plays inside the app through that
|
|
4
|
+
site's own player: an `<iframe>` whose `src` is the service's embed page. No key,
|
|
5
|
+
no backend, and no fetch from your code. The service skill that loaded this page
|
|
6
|
+
says how its links turn into an embed `src`; this page is how every embed
|
|
7
|
+
behaves once you have one.
|
|
8
|
+
|
|
9
|
+
## Keep the link, build the frame
|
|
10
|
+
|
|
11
|
+
What a person pastes is a share link, and the link is what the app stores. The
|
|
12
|
+
service skill's parser turns it into an embed `src` at render time, and anything
|
|
13
|
+
that does not parse is refused with the input kept on screen ("That isn't a
|
|
14
|
+
YouTube link — paste the address from the Share button"), never saved.
|
|
15
|
+
|
|
16
|
+
Build the `src` from the parsed id only, and never render pasted embed HTML
|
|
17
|
+
(`dangerouslySetInnerHTML` with an `<iframe …>` someone copied): pasted markup
|
|
18
|
+
is someone else's HTML running in this page, and an id cannot carry a script.
|
|
19
|
+
|
|
20
|
+
## One frame component
|
|
21
|
+
|
|
22
|
+
Every embed renders through one component that owns the frame's attributes,
|
|
23
|
+
so a list of ten players carries the same rules ten times without ten copies.
|
|
24
|
+
|
|
25
|
+
```jsx
|
|
26
|
+
// A video keeps its shape as the column narrows; an audio player has the fixed
|
|
27
|
+
// height its service names, so pass `height` for those.
|
|
28
|
+
const ALLOW = "autoplay; encrypted-media; fullscreen; clipboard-write";
|
|
29
|
+
function EmbedFrame({ src, title, height }) {
|
|
30
|
+
if (height) {
|
|
31
|
+
return (
|
|
32
|
+
<iframe src={src} title={title} height={height} width="100%" loading="lazy" allow={ALLOW}
|
|
33
|
+
referrerPolicy="strict-origin-when-cross-origin" className="block border-0" />
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return (
|
|
37
|
+
<iframe src={src} title={title} loading="lazy" allow={ALLOW}
|
|
38
|
+
referrerPolicy="strict-origin-when-cross-origin" className="block w-full aspect-video border-0" />
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- **`title` is required.** It is what a screen reader announces for the frame:
|
|
44
|
+
the video's or track's name, never "embed" or "player".
|
|
45
|
+
- **`loading="lazy"`** keeps players below the fold from loading until they
|
|
46
|
+
scroll near.
|
|
47
|
+
- **`allow` asks only for what the app's own frame was given.** A vibe runs
|
|
48
|
+
inside a frame of its own, and a frame nested in it can be granted only what
|
|
49
|
+
that outer frame delegates: `autoplay`, `encrypted-media` (full-length
|
|
50
|
+
streams), `fullscreen` and `clipboard-write` are delegated. Picture-in-picture
|
|
51
|
+
is not, so asking for it does nothing.
|
|
52
|
+
- **The referrer stays on.** Players check where they are embedded, and some
|
|
53
|
+
refuse to play with no referrer at all, so never set
|
|
54
|
+
`referrerPolicy="no-referrer"` on a player.
|
|
55
|
+
- **Nothing autoplays with sound.** Browsers block it until the person presses
|
|
56
|
+
something, and a page that starts talking is a page people close. The
|
|
57
|
+
player's own play button is the gesture.
|
|
58
|
+
|
|
59
|
+
## A link out under every player
|
|
60
|
+
|
|
61
|
+
The player's insides are another origin: your code cannot read whether it
|
|
62
|
+
loaded, and a refusal (embedding turned off by the uploader, a region lock, an
|
|
63
|
+
age gate) shows only inside the frame. So every player has a plain link to the
|
|
64
|
+
same item on its own site beneath it ("Open on YouTube", "Listen on Spotify"),
|
|
65
|
+
which is also the way to the full experience.
|
|
66
|
+
|
|
67
|
+
## Many players: show a card, load the frame on press
|
|
68
|
+
|
|
69
|
+
A page of twenty embeds loads twenty players. Show each item as a card with its
|
|
70
|
+
thumbnail and title, and swap in the `EmbedFrame` when the person presses play,
|
|
71
|
+
so only the one they chose loads. The frame then needs the press to start, so
|
|
72
|
+
the service's embed parameter for "start on load" is fine there, and only there.
|
|
73
|
+
Pass the service's fixed player height through (Spotify's 152 or 352), so the
|
|
74
|
+
opened frame keeps the shape its service draws in.
|
|
75
|
+
|
|
76
|
+
```jsx
|
|
77
|
+
function PlayerFacade({ item, src, height }) {
|
|
78
|
+
const [open, setOpen] = useState(false);
|
|
79
|
+
if (open) return <EmbedFrame src={src} title={item.title} height={height} />;
|
|
80
|
+
return (
|
|
81
|
+
<div>
|
|
82
|
+
{item.thumbnail && <img src={item.thumbnail} alt="" className="block w-full" />}
|
|
83
|
+
<Button type="button" onClick={() => setOpen(true)}>Play {item.title}</Button>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## A title and thumbnail without a key: oEmbed
|
|
90
|
+
|
|
91
|
+
Most players publish an oEmbed endpoint: a keyless GET that answers a share
|
|
92
|
+
link with its `title`, `author_name` and `thumbnail_url`. The service skill
|
|
93
|
+
names its endpoint. Read it once, when the person adds the item (in the add
|
|
94
|
+
handler, never during render), and store the answer on the record with the link,
|
|
95
|
+
so the list renders from the app's own data. When the call fails in any way (an
|
|
96
|
+
error status, no network, an answer that is not JSON), save the link anyway with
|
|
97
|
+
the link itself as its title: the player still plays.
|
|
98
|
+
|
|
99
|
+
```jsx
|
|
100
|
+
async function fetchOEmbed(endpoint, link) {
|
|
101
|
+
try {
|
|
102
|
+
const r = await fetch(`${endpoint}?url=${encodeURIComponent(link)}&format=json`);
|
|
103
|
+
if (!r.ok) return { title: link };
|
|
104
|
+
const o = await r.json();
|
|
105
|
+
return { title: o.title ?? link, author: o.author_name ?? null, thumbnail: o.thumbnail_url ?? null };
|
|
106
|
+
} catch {
|
|
107
|
+
return { title: link };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
```
|
package/llms/three-js.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const threeJsConfig = {
|
|
2
2
|
name: "three-js",
|
|
3
3
|
label: "Three.js",
|
|
4
|
-
description: "Three.js 3D graphics library for WebGL rendering: mesh geometry, materials, lighting, animation, cameras, textures, GLSL shaders, GLTF/OBJ/FBX model loading, physics, particle systems, post-processing, visual effects, 3js. Anything played or steered also loads touch-games for phone controls",
|
|
4
|
+
description: "Three.js 3D graphics library for WebGL rendering: mesh geometry, materials, lighting, animation, cameras, textures, GLSL shaders, GLTF/OBJ/FBX model loading, physics, particle systems, post-processing, visual effects, 3js. Anything played or steered also loads touch-games for phone controls; a place the person walks through as a player (a garden, house, museum or cave, first-person) also loads world-controls, and a model turned, spun or orbited on its own (a product viewer, a globe) stays three-js",
|
|
5
5
|
cues: ["3d", "three.js", "threejs", "3js", "webgl", "shader", "shaders", "mesh", "gltf", "3d model", "3d scene"],
|
|
6
6
|
importModule: "three",
|
|
7
7
|
importName: "THREE",
|
package/llms/three-js.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"three-js.js","sourceRoot":"","sources":["../../jsr/llms/three-js.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"three-js.js","sourceRoot":"","sources":["../../jsr/llms/three-js.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;IACjB,WAAW,EACT,wfAAwf;IAC1f,IAAI,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC;IAChH,YAAY,EAAE,OAAO;IACrB,UAAU,EAAE,OAAO;IACnB,UAAU,EAAE,WAAW;CACxB,CAAC"}
|
package/llms/three-js.md
CHANGED
|
@@ -95,7 +95,7 @@ title, settings, scores, sharing and every other panel live behind **one** menu
|
|
|
95
95
|
top-right corner (`IconButton`, never the bottom-right, which the platform owns) that toggles an
|
|
96
96
|
overlay — see the Sky Glider example below. The game stays in view the moment the overlay closes.
|
|
97
97
|
|
|
98
|
-
The lens follows the screen:
|
|
98
|
+
The lens follows the screen: set the camera's aspect from the canvas on every resize, and widen the view on a phone held upright (a walked world gets both from `world-controls`).
|
|
99
99
|
An overview camera that orbits the scene keeps its own distance: scale the radius by
|
|
100
100
|
`0.36 / (tan(fov / 2) · aspect)`, clamped to 1–2.2×, so the whole scene stays in frame upright.
|
|
101
101
|
|
|
@@ -125,7 +125,7 @@ those touches to the scene with `select-none touch-none` on the mount `<div>` /
|
|
|
125
125
|
on the container that holds the HUD and labels. `OrbitControls` already speaks pointer events and
|
|
126
126
|
receives the drag once its element is `touch-none`.
|
|
127
127
|
|
|
128
|
-
- A world you move through — walked, explored, flown around — calls `useWorldControls` from `use-vibes`, taught in the `
|
|
128
|
+
- A world you move through — walked, explored, flown around — calls `useWorldControls` from `use-vibes`, taught in the `world-controls` skill: left thumb walks, right thumb looks, tap acts, and a click-to-play overlay carries the desktop.
|
|
129
129
|
- A flyer or a car that charges forward calls for hold + steer from the `touch-games` skill: thumb down is the throttle and its offset steers.
|
|
130
130
|
|
|
131
131
|
## Core Setup
|
|
@@ -1257,7 +1257,6 @@ Structure your component in this order:
|
|
|
1257
1257
|
import React, { useState, useEffect, useRef, useCallback } from "react";
|
|
1258
1258
|
import { useFireproof } from "use-fireproof";
|
|
1259
1259
|
import * as THREE from "three";
|
|
1260
|
-
import { useWorldControls } from "use-vibes";
|
|
1261
1260
|
import { Card, Heading, IconButton, Stack, Text } from "@vibes.diy/ui";
|
|
1262
1261
|
|
|
1263
1262
|
export default function SkyGlider() {
|
|
@@ -1278,6 +1277,7 @@ export default function SkyGlider() {
|
|
|
1278
1277
|
score: 0,
|
|
1279
1278
|
gameRunning: false,
|
|
1280
1279
|
stick: { x: 0, y: 0 },
|
|
1280
|
+
held: new Set(),
|
|
1281
1281
|
velocity: { x: 0, y: 0, z: 0 },
|
|
1282
1282
|
heading: 0,
|
|
1283
1283
|
forwardSpeed: 0,
|
|
@@ -1288,17 +1288,47 @@ export default function SkyGlider() {
|
|
|
1288
1288
|
const [currentScore, setCurrentScore] = useState(0);
|
|
1289
1289
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
1290
1290
|
|
|
1291
|
-
//
|
|
1292
|
-
//
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1291
|
+
// Hold + steer, the flyer's scheme (the touch-games skill has it in full): thumb down thrusts,
|
|
1292
|
+
// and its offset from where it landed banks and pitches. One pointer path for finger, pen and
|
|
1293
|
+
// mouse; on a keyboard WASD or the arrows steer and Space thrusts.
|
|
1294
|
+
useEffect(() => {
|
|
1295
|
+
const root = rootRef.current;
|
|
1296
|
+
const { stick, held } = gameStateRef.current;
|
|
1297
|
+
let thumb = null;
|
|
1298
|
+
const down = (e) => {
|
|
1299
|
+
if (e.target.closest("button")) return; // the HUD's own buttons keep their presses
|
|
1300
|
+
root.setPointerCapture(e.pointerId);
|
|
1301
|
+
thumb = { id: e.pointerId, x: e.clientX, y: e.clientY };
|
|
1302
|
+
held.add("Space");
|
|
1303
|
+
};
|
|
1304
|
+
const move = (e) => {
|
|
1305
|
+
if (thumb?.id !== e.pointerId) return;
|
|
1306
|
+
const reach = (d) => Math.max(-1, Math.min(1, d / 60)); // 60px of offset is full deflection
|
|
1307
|
+
Object.assign(stick, { x: reach(e.clientX - thumb.x), y: reach(e.clientY - thumb.y) });
|
|
1308
|
+
};
|
|
1309
|
+
const up = (e) => {
|
|
1310
|
+
if (thumb?.id !== e.pointerId) return;
|
|
1311
|
+
thumb = null;
|
|
1312
|
+
held.delete("Space");
|
|
1313
|
+
Object.assign(stick, { x: 0, y: 0 });
|
|
1314
|
+
};
|
|
1315
|
+
const keyDown = (e) => !e.repeat && held.add(e.code);
|
|
1316
|
+
const keyUp = (e) => held.delete(e.code);
|
|
1317
|
+
root.addEventListener("pointerdown", down);
|
|
1318
|
+
root.addEventListener("pointermove", move);
|
|
1319
|
+
root.addEventListener("pointerup", up);
|
|
1320
|
+
root.addEventListener("pointercancel", up);
|
|
1321
|
+
window.addEventListener("keydown", keyDown);
|
|
1322
|
+
window.addEventListener("keyup", keyUp);
|
|
1323
|
+
return () => {
|
|
1324
|
+
root.removeEventListener("pointerdown", down);
|
|
1325
|
+
root.removeEventListener("pointermove", move);
|
|
1326
|
+
root.removeEventListener("pointerup", up);
|
|
1327
|
+
root.removeEventListener("pointercancel", up);
|
|
1328
|
+
window.removeEventListener("keydown", keyDown);
|
|
1329
|
+
window.removeEventListener("keyup", keyUp);
|
|
1330
|
+
};
|
|
1331
|
+
}, []);
|
|
1302
1332
|
const { docs: scoreData } = useLiveQuery("type", { key: "score" }) || {
|
|
1303
1333
|
docs: [],
|
|
1304
1334
|
};
|
|
@@ -1552,6 +1582,8 @@ export default function SkyGlider() {
|
|
|
1552
1582
|
const state = gameStateRef.current;
|
|
1553
1583
|
if (!state.renderer) return;
|
|
1554
1584
|
state.renderer.setSize(window.innerWidth, window.innerHeight);
|
|
1585
|
+
state.camera.aspect = window.innerWidth / window.innerHeight;
|
|
1586
|
+
state.camera.updateProjectionMatrix();
|
|
1555
1587
|
}, []);
|
|
1556
1588
|
|
|
1557
1589
|
const updateGame = useCallback((dt) => {
|
|
@@ -1559,11 +1591,13 @@ export default function SkyGlider() {
|
|
|
1559
1591
|
if (!state.gameRunning || !state.glider) return;
|
|
1560
1592
|
|
|
1561
1593
|
const { stick, held, glider } = state;
|
|
1562
|
-
|
|
1594
|
+
const key = (a, b) => (held.has(a) || held.has(b) ? 1 : 0);
|
|
1595
|
+
const steerX = key("KeyD", "ArrowRight") - key("KeyA", "ArrowLeft") || stick.x;
|
|
1596
|
+
const steerY = key("KeyS", "ArrowDown") - key("KeyW", "ArrowUp") || stick.y;
|
|
1563
1597
|
|
|
1564
|
-
// Controls: the
|
|
1565
|
-
state.heading -=
|
|
1566
|
-
state.pitch -=
|
|
1598
|
+
// Controls: the thumb's offset (or WASD) banks and pitches; a held thumb or Space thrusts
|
|
1599
|
+
state.heading -= steerX * 0.03;
|
|
1600
|
+
state.pitch -= steerY * 0.01; // forward on the stick (y < 0) climbs
|
|
1567
1601
|
if (held.has("Space")) state.forwardSpeed = Math.min(0.3, state.forwardSpeed + 0.005);
|
|
1568
1602
|
|
|
1569
1603
|
// Physics
|
package/llms/touch-games.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
export const touchGamesConfig = {
|
|
2
2
|
name: "touch-games",
|
|
3
|
+
needs: ["sound-core", "surface-play-area"],
|
|
3
4
|
label: "Touch games",
|
|
4
|
-
description: "Phone-first controls for
|
|
5
|
-
"
|
|
5
|
+
description: "Phone-first controls for every game played in real time, tapped or steered (a turn-based board, card or word game " +
|
|
6
|
+
"is board-games) — load it on its own for a tap game or a whack-a-mole grid, and beside three-js, voxel, physics, p5, " +
|
|
7
|
+
"worlds or ui-game for every other real-time game, 3D scene you move through, or canvas toy: the play area " +
|
|
6
8
|
"is the controller (select-none touch-none surface, Pointer Events with pointer capture), swipes that fire " +
|
|
7
9
|
"mid-move with chaining, tap vs swipe on one surface, a floating ghost stick under the thumb, hold-to-boost " +
|
|
8
|
-
"with drag steering, pull-back-and-release aiming, gesture trails and feedback,
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"platformer, arcade, one thumb, first-person, walk around, explore",
|
|
10
|
+
"with drag steering, pull-back-and-release aiming, gesture trails and feedback, sound effects on the core " +
|
|
11
|
+
"actions with a mute toggle, the world painted in the app's look, and keyboard twins for desktop. " +
|
|
12
|
+
"game, mobile game, tap game, whack-a-mole, reflex game, touch controls, swipe, joystick, runner, racer, flyer, " +
|
|
13
|
+
"shooter, snake, slingshot, platformer, arcade, flappy, one thumb",
|
|
13
14
|
cues: [
|
|
15
|
+
"whack-a-mole",
|
|
16
|
+
"whack a mole",
|
|
17
|
+
"tap game",
|
|
14
18
|
"swipe",
|
|
15
19
|
"touch controls",
|
|
16
20
|
"mobile game",
|
|
@@ -38,10 +42,6 @@ export const touchGamesConfig = {
|
|
|
38
42
|
"catapult",
|
|
39
43
|
"flappy",
|
|
40
44
|
"snake game",
|
|
41
|
-
"first-person",
|
|
42
|
-
"first person",
|
|
43
|
-
"walk around",
|
|
44
|
-
"explore",
|
|
45
45
|
],
|
|
46
46
|
};
|
|
47
47
|
//# sourceMappingURL=touch-games.js.map
|
package/llms/touch-games.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"touch-games.js","sourceRoot":"","sources":["../../jsr/llms/touch-games.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAc;IACzC,IAAI,EAAE,aAAa;
|
|
1
|
+
{"version":3,"file":"touch-games.js","sourceRoot":"","sources":["../../jsr/llms/touch-games.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAc;IACzC,IAAI,EAAE,aAAa;IAInB,KAAK,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC1C,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,oHAAoH;QACpH,uHAAuH;QACvH,4GAA4G;QAC5G,4GAA4G;QAC5G,6GAA6G;QAC7G,2GAA2G;QAC3G,mGAAmG;QACnG,iHAAiH;QACjH,kEAAkE;IAKpE,IAAI,EAAE;QACJ,cAAc;QACd,cAAc;QACd,UAAU;QACV,OAAO;QACP,gBAAgB;QAChB,aAAa;QACb,YAAY;QACZ,YAAY;QACZ,aAAa;QACb,cAAc;QACd,aAAa;QACb,UAAU;QACV,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,OAAO;QACP,SAAS;QACT,YAAY;QACZ,gBAAgB;QAChB,SAAS;QACT,aAAa;QACb,aAAa;QACb,OAAO;QACP,SAAS;QACT,WAAW;QACX,SAAS;QACT,WAAW;QACX,UAAU;QACV,QAAQ;QACR,YAAY;KACb;CACF,CAAC"}
|