castle-web-cli 0.4.232 → 0.4.234
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/dist/agent-failures.d.ts +8 -0
- package/dist/agent-failures.js +19 -2
- package/dist/agent-prompts.d.ts +1 -1
- package/dist/agent-prompts.js +10 -3
- package/dist/agent.d.ts +64 -3
- package/dist/agent.js +170 -81
- package/dist/api.d.ts +11 -0
- package/dist/api.js +43 -0
- package/dist/bundle.d.ts +64 -0
- package/dist/bundle.js +558 -2
- package/dist/castle-host/host.d.ts +18 -2
- package/dist/castle-host/host.js +844 -39
- package/dist/castleJson.d.ts +23 -2
- package/dist/castleJson.js +46 -2
- package/dist/check.d.ts +3 -1
- package/dist/check.js +20 -3
- package/dist/chunkLoader.d.ts +3 -0
- package/dist/chunkLoader.js +111 -0
- package/dist/devParty.d.ts +26 -0
- package/dist/devParty.js +231 -0
- package/dist/devSaveStorage.js +4 -0
- package/dist/devSessionStorage.js +50 -2
- package/dist/devSocial.d.ts +24 -0
- package/dist/devSocial.js +70 -0
- package/dist/ide.d.ts +2 -0
- package/dist/ide.js +119 -15
- package/dist/importPinMismatch.d.ts +22 -0
- package/dist/importPinMismatch.js +77 -0
- package/dist/importRegression.js +3 -15
- package/dist/imports.d.ts +10 -3
- package/dist/imports.js +88 -20
- package/dist/index.js +11 -4
- package/dist/init.js +1 -1
- package/dist/platformDoc.js +22 -0
- package/dist/routerFences.d.ts +5 -0
- package/dist/routerFences.js +12 -2
- package/dist/save-deck.d.ts +25 -1
- package/dist/save-deck.js +178 -9
- package/dist/serve.js +32 -11
- package/dist/shell/assets/{index-D2tWM896.js → index-DulbYIJm.js} +97 -97
- package/dist/shell/assets/index-MVLfNYd9.css +1 -0
- package/dist/shell/index.html +2 -2
- package/dist/taskSteer.d.ts +13 -0
- package/dist/taskSteer.js +22 -2
- package/dist/vitePlugins.d.ts +2 -1
- package/dist/vitePlugins.js +13 -0
- package/kits/base/castle.json +1 -1
- package/kits/base/package-lock.json +1 -1
- package/kits/base/sdk/README.md +339 -5
- package/kits/base/sdk/avatar.d.ts +6 -2
- package/kits/base/sdk/avatar.js +12 -4
- package/kits/base/sdk/castle.d.ts +7 -3
- package/kits/base/sdk/castle.js +2 -0
- package/kits/base/sdk/commands.d.ts +176 -1
- package/kits/base/sdk/commands.js +3 -0
- package/kits/base/sdk/display.d.ts +3 -0
- package/kits/base/sdk/display.js +9 -3
- package/kits/base/sdk/hub.d.ts +37 -6
- package/kits/base/sdk/hub.js +63 -4
- package/kits/base/sdk/multiplayer.d.ts +7 -1
- package/kits/base/sdk/multiplayer.js +148 -32
- package/kits/base/sdk/multiplayerProtocol.d.ts +2 -0
- package/kits/base/sdk/party.d.ts +23 -0
- package/kits/base/sdk/party.js +91 -0
- package/kits/base/sdk/reconnectBudget.d.ts +23 -0
- package/kits/base/sdk/reconnectBudget.js +96 -0
- package/kits/base/sdk/save.d.ts +38 -1
- package/kits/base/sdk/save.js +81 -7
- package/kits/base/sdk/server/hub.d.ts +117 -0
- package/kits/base/sdk/server/hub.js +119 -2
- package/kits/base/sdk/server/platformHandle.d.ts +43 -1
- package/kits/base/sdk/server/storage.d.ts +17 -0
- package/kits/base/sdk/server/storage.js +65 -3
- package/kits/base/sdk/server/wrapper.d.ts +43 -6
- package/kits/base/sdk/server/wrapper.js +93 -9
- package/kits/base/sdk/social.d.ts +9 -0
- package/kits/base/sdk/social.js +5 -0
- package/kits/hub-game/CLAUDE.md +451 -13
- package/kits/hub-game/README.md +63 -0
- package/kits/hub-game/blueprints/avatar-10.scene +28 -0
- package/kits/hub-game/blueprints/avatar-11.scene +28 -0
- package/kits/hub-game/blueprints/avatar-12.scene +28 -0
- package/kits/hub-game/blueprints/avatar-13.scene +28 -0
- package/kits/hub-game/blueprints/avatar-14.scene +28 -0
- package/kits/hub-game/blueprints/avatar-15.scene +28 -0
- package/kits/hub-game/blueprints/avatar-4.scene +28 -0
- package/kits/hub-game/blueprints/avatar-5.scene +28 -0
- package/kits/hub-game/blueprints/avatar-6.scene +28 -0
- package/kits/hub-game/blueprints/avatar-7.scene +28 -0
- package/kits/hub-game/blueprints/avatar-8.scene +28 -0
- package/kits/hub-game/blueprints/avatar-9.scene +28 -0
- package/kits/hub-game/castle.json +5 -5
- package/kits/hub-game/code/client/act.js +312 -0
- package/kits/hub-game/code/client/actionLayout.js +147 -0
- package/kits/hub-game/code/client/actionOverflow.js +556 -0
- package/kits/hub-game/code/client/actorBudget.js +47 -0
- package/kits/hub-game/code/client/arrivalCamera.js +50 -0
- package/kits/hub-game/code/client/askSlot.js +117 -0
- package/kits/hub-game/code/client/attention.js +11 -2
- package/kits/hub-game/code/client/avatar.js +311 -35
- package/kits/hub-game/code/client/avatarCap.js +228 -0
- package/kits/hub-game/code/client/avatarColors.js +70 -0
- package/kits/hub-game/code/client/avatarFaces.js +21 -0
- package/kits/hub-game/code/client/avatarShare.js +253 -0
- package/kits/hub-game/code/client/backVisibility.js +13 -0
- package/kits/hub-game/code/client/ballot.js +472 -0
- package/kits/hub-game/code/client/build.js +38 -0
- package/kits/hub-game/code/client/chat.js +41 -5
- package/kits/hub-game/code/client/chatModeration.js +5 -0
- package/kits/hub-game/code/client/chrome.js +2144 -160
- package/kits/hub-game/code/client/companion.js +716 -0
- package/kits/hub-game/code/client/companionDress.js +99 -0
- package/kits/hub-game/code/client/crowdNames.js +241 -0
- package/kits/hub-game/code/client/decor.js +515 -0
- package/kits/hub-game/code/client/defaultEnvironment.js +194 -0
- package/kits/hub-game/code/client/doorErrors.js +39 -0
- package/kits/hub-game/code/client/earned.js +131 -0
- package/kits/hub-game/code/client/emoteBubble.js +75 -0
- package/kits/hub-game/code/client/fall.js +18 -0
- package/kits/hub-game/code/client/farAvatars.js +233 -0
- package/kits/hub-game/code/client/firstJoin.js +9 -2
- package/kits/hub-game/code/client/fpsTelemetry.js +50 -0
- package/kits/hub-game/code/client/frameBatch.js +5 -0
- package/kits/hub-game/code/client/grab.js +368 -29
- package/kits/hub-game/code/client/hookLayer.js +385 -20
- package/kits/hub-game/code/client/hudCopy.js +51 -0
- package/kits/hub-game/code/client/hudRate.js +20 -0
- package/kits/hub-game/code/client/idle.js +177 -24
- package/kits/hub-game/code/client/interestCap.js +81 -0
- package/kits/hub-game/code/client/invites.js +231 -0
- package/kits/hub-game/code/client/joinError.js +9 -0
- package/kits/hub-game/code/client/keys.js +36 -0
- package/kits/hub-game/code/client/labelsNear.js +234 -0
- package/kits/hub-game/code/client/landscapeLayout.js +17 -0
- package/kits/hub-game/code/client/layoutCache.js +264 -0
- package/kits/hub-game/code/client/loadTelemetry.js +20 -0
- package/kits/hub-game/code/client/loadingCover.js +148 -0
- package/kits/hub-game/code/client/loadingEntry.js +8 -0
- package/kits/hub-game/code/client/menuIcons.js +34 -0
- package/kits/hub-game/code/client/menuRows.js +43 -0
- package/kits/hub-game/code/client/modelReady.js +7 -0
- package/kits/hub-game/code/client/pack.js +6 -2
- package/kits/hub-game/code/client/packFormat.js +3 -3
- package/kits/hub-game/code/client/padCueArrival.js +23 -0
- package/kits/hub-game/code/client/padCues.js +112 -0
- package/kits/hub-game/code/client/padOccupancy.js +88 -0
- package/kits/hub-game/code/client/padReadability.js +26 -0
- package/kits/hub-game/code/client/padRings.js +69 -0
- package/kits/hub-game/code/client/pushVisit.js +14 -0
- package/kits/hub-game/code/client/quality.js +205 -0
- package/kits/hub-game/code/client/qualityEntry.js +55 -0
- package/kits/hub-game/code/client/rehello.js +167 -0
- package/kits/hub-game/code/client/safeLayout.js +338 -0
- package/kits/hub-game/code/client/safeStyle.js +42 -0
- package/kits/hub-game/code/client/say.js +12 -3
- package/kits/hub-game/code/client/shot.js +146 -0
- package/kits/hub-game/code/client/shotFit.js +56 -0
- package/kits/hub-game/code/client/signIn.js +28 -0
- package/kits/hub-game/code/client/sound.js +63 -8
- package/kits/hub-game/code/client/soundscape.js +1151 -0
- package/kits/hub-game/code/client/soundscapeActions.js +99 -0
- package/kits/hub-game/code/client/soundscapeAmbience.js +453 -0
- package/kits/hub-game/code/client/soundscapeBaked.js +143 -0
- package/kits/hub-game/code/client/soundscapeBusker.js +217 -0
- package/kits/hub-game/code/client/soundscapeCourt.js +200 -0
- package/kits/hub-game/code/client/soundscapeCrowd.js +331 -0
- package/kits/hub-game/code/client/soundscapeCues.js +362 -0
- package/kits/hub-game/code/client/soundscapeMap.js +181 -0
- package/kits/hub-game/code/client/soundscapeMarket.js +176 -0
- package/kits/hub-game/code/client/soundscapeMusic.js +126 -0
- package/kits/hub-game/code/client/soundscapeMusicEngine.js +460 -0
- package/kits/hub-game/code/client/soundscapeSimlish.js +737 -0
- package/kits/hub-game/code/client/soundscapeSongs.js +127 -0
- package/kits/hub-game/code/client/soundscapeSongsRound3.js +63 -0
- package/kits/hub-game/code/client/soundscapeSynthesis.js +168 -0
- package/kits/hub-game/code/client/soundscapeUi.js +211 -0
- package/kits/hub-game/code/client/soundscapeVoice.js +1209 -0
- package/kits/hub-game/code/client/soundscapeWaves.js +206 -0
- package/kits/hub-game/code/client/spin.js +101 -0
- package/kits/hub-game/code/client/state.js +162 -1
- package/kits/hub-game/code/client/stuck.js +259 -0
- package/kits/hub-game/code/client/talk.js +714 -59
- package/kits/hub-game/code/client/tiers.js +543 -52
- package/kits/hub-game/code/client/toastBand.js +37 -0
- package/kits/hub-game/code/client/together.js +39 -2
- package/kits/hub-game/code/client/visibility.js +43 -0
- package/kits/hub-game/code/client/weakestLookBake.js +92 -0
- package/kits/hub-game/code/client/weakestTier.js +295 -0
- package/kits/hub-game/code/client/wear.js +461 -170
- package/kits/hub-game/code/client/worldLabels.js +241 -0
- package/kits/hub-game/code/client/yours.js +200 -0
- package/kits/hub-game/code/companionSpec.js +45 -0
- package/kits/hub-game/code/npcDisplayText.js +55 -0
- package/kits/hub-game/code/privateText.js +7 -0
- package/kits/hub-game/code/server/act.js +124 -0
- package/kits/hub-game/code/server/actions.js +138 -0
- package/kits/hub-game/code/server/actors.js +11 -2
- package/kits/hub-game/code/server/analytics.js +83 -0
- package/kits/hub-game/code/server/anonymousEntry.js +49 -0
- package/kits/hub-game/code/server/arrivalPose.js +36 -0
- package/kits/hub-game/code/server/ask.js +155 -0
- package/kits/hub-game/code/server/ballot.js +539 -0
- package/kits/hub-game/code/server/cells.js +100 -0
- package/kits/hub-game/code/server/companion.js +107 -0
- package/kits/hub-game/code/server/cues.js +70 -0
- package/kits/hub-game/code/server/decor.js +269 -0
- package/kits/hub-game/code/server/doorAnalytics.js +52 -0
- package/kits/hub-game/code/server/earned.js +478 -0
- package/kits/hub-game/code/server/frameBatch.js +183 -0
- package/kits/hub-game/code/server/friendBests.js +166 -0
- package/kits/hub-game/code/server/friendsAmong.js +272 -0
- package/kits/hub-game/code/server/history.js +7 -0
- package/kits/hub-game/code/server/hub.js +2510 -95
- package/kits/hub-game/code/server/idle.js +60 -12
- package/kits/hub-game/code/server/index.js +28 -6
- package/kits/hub-game/code/server/invites.js +19 -0
- package/kits/hub-game/code/server/labels.js +36 -2
- package/kits/hub-game/code/server/loadAbandon.js +106 -0
- package/kits/hub-game/code/server/manifest.js +586 -7
- package/kits/hub-game/code/server/menu.js +161 -0
- package/kits/hub-game/code/server/npcs.js +1025 -113
- package/kits/hub-game/code/server/observe.js +408 -0
- package/kits/hub-game/code/server/padOccupancy.js +85 -0
- package/kits/hub-game/code/server/party.js +2 -2
- package/kits/hub-game/code/server/players.js +30 -0
- package/kits/hub-game/code/server/resumePose.js +152 -0
- package/kits/hub-game/code/server/say.js +1 -1
- package/kits/hub-game/code/server/shot.js +110 -0
- package/kits/hub-game/code/server/standing.js +123 -0
- package/kits/hub-game/code/server/storageLimit.js +187 -0
- package/kits/hub-game/code/server/vis.js +175 -0
- package/kits/hub-game/code/server/wear.js +12 -0
- package/kits/hub-game/code/server/yours.js +59 -0
- package/kits/hub-game/code/shared/act.js +35 -0
- package/kits/hub-game/code/shared/cues.js +9 -0
- package/kits/hub-game/code/shared/danceIdle.js +28 -0
- package/kits/hub-game/code/shared/decor.js +41 -0
- package/kits/hub-game/code/shared/loadStages.js +12 -0
- package/kits/hub-game/code/shared/quality.js +74 -0
- package/kits/hub-game/code/shared/say.js +2 -0
- package/kits/hub-game/code/shared/shot.js +53 -0
- package/kits/hub-game/code/shared/spin.js +57 -0
- package/kits/hub-game/code/systems/hub.js +1753 -202
- package/kits/hub-game/docs/analytics.md +279 -0
- package/kits/hub-game/docs/content-pack.md +1 -1
- package/kits/hub-game/docs/contract.md +3475 -77
- package/kits/hub-game/docs/home-pieces.md +71 -0
- package/kits/hub-game/docs/observed-progress.md +252 -0
- package/kits/hub-game/main.jsx +2 -0
- package/kits/hub-game/models/avatar-10.pxmodel +28 -0
- package/kits/hub-game/models/avatar-11.pxmodel +28 -0
- package/kits/hub-game/models/avatar-12.pxmodel +27 -0
- package/kits/hub-game/models/avatar-13.pxmodel +24 -0
- package/kits/hub-game/models/avatar-14.pxmodel +29 -0
- package/kits/hub-game/models/avatar-15.pxmodel +24 -0
- package/kits/hub-game/models/avatar-4.pxmodel +29 -0
- package/kits/hub-game/models/avatar-5.pxmodel +27 -0
- package/kits/hub-game/models/avatar-6.pxmodel +26 -0
- package/kits/hub-game/models/avatar-7.pxmodel +25 -0
- package/kits/hub-game/models/avatar-8.pxmodel +24 -0
- package/kits/hub-game/models/avatar-9.pxmodel +30 -0
- package/kits/hub-game/models/earned/badge-round.pxmodel +100 -0
- package/kits/hub-game/models/earned/badge-shield.pxmodel +117 -0
- package/kits/hub-game/models/earned/badge-star.pxmodel +87 -0
- package/kits/hub-game/models/earned/belt-plain.pxmodel +72 -0
- package/kits/hub-game/models/earned/held-ball.pxmodel +43 -0
- package/kits/hub-game/models/earned/held-lantern.pxmodel +85 -0
- package/kits/hub-game/models/earned/held-net.pxmodel +57 -0
- package/kits/hub-game/models/earned/held-trophy.pxmodel +109 -0
- package/kits/hub-game/models/earned/pin-round.pxmodel +62 -0
- package/kits/hub-game/models/earned/sash-plain.pxmodel +66 -0
- package/kits/hub-game/models/earned/square/belt-plain.pxmodel +104 -0
- package/kits/hub-game/models/earned/square/sash-plain.pxmodel +98 -0
- package/kits/hub-game/models/hats/bat-clip.pxmodel +206 -0
- package/kits/hub-game/models/hats/beekeeper.pxmodel +149 -0
- package/kits/hub-game/models/hats/cap.pxmodel +162 -0
- package/kits/hub-game/models/hats/captain.pxmodel +178 -0
- package/kits/hub-game/models/hats/crooked-top.pxmodel +172 -0
- package/kits/hub-game/models/hats/flower-crown.pxmodel +451 -0
- package/kits/hub-game/models/hats/foam-crown.pxmodel +179 -0
- package/kits/hub-game/models/hats/lantern.pxmodel +230 -0
- package/kits/hub-game/models/hats/laurel.pxmodel +533 -0
- package/kits/hub-game/models/hats/lighthouse.pxmodel +96 -0
- package/kits/hub-game/models/hats/sailor.pxmodel +141 -0
- package/kits/hub-game/models/hats/souwester.pxmodel +131 -0
- package/kits/hub-game/models/hats/straw.pxmodel +139 -0
- package/kits/hub-game/models/hats/sunflower.pxmodel +406 -0
- package/kits/hub-game/models/hats/sweatband.pxmodel +112 -0
- package/kits/hub-game/models/hats/witch.pxmodel +147 -0
- package/kits/hub-game/package-lock.json +10 -1
- package/kits/hub-game/package.json +6 -2
- package/kits/hub-game/play/player.js +142 -0
- package/kits/hub-game/play/registry.js +47 -0
- package/kits/hub-game/play.jsx +37 -0
- package/kits/hub-game/scripts/check.mjs +117 -16
- package/kits/hub-game/scripts/companion-follower-wire.json +1 -0
- package/kits/hub-game/scripts/fixtures/decor-keyless-draw.json +132 -0
- package/kits/hub-game/scripts/fixtures/decor-keyless.json +293 -0
- package/kits/hub-game/scripts/fixtures/engine-models-stub.mjs +26 -0
- package/kits/hub-game/scripts/fixtures/fake-dom.mjs +123 -0
- package/kits/hub-game/scripts/fixtures/interest-legacy.json +385 -0
- package/kits/hub-game/scripts/fixtures/npc-notes-v1.77.jsonl +4 -0
- package/kits/hub-game/scripts/fixtures/vis-shared-wire.json +1 -0
- package/kits/hub-game/scripts/gen-avatars.mjs +933 -16
- package/kits/hub-game/scripts/gen-earned.mjs +285 -0
- package/kits/hub-game/scripts/gen-hats.mjs +827 -0
- package/kits/hub-game/scripts/grab.before-orbit.mjs +400 -0
- package/kits/hub-game/scripts/pose-storage-fixture.mjs +46 -0
- package/kits/hub-game/scripts/soundscape-wave-analysis.mjs +125 -0
- package/kits/hub-game/scripts/test-act-client.mjs +186 -0
- package/kits/hub-game/scripts/test-act.mjs +171 -0
- package/kits/hub-game/scripts/test-action-layout.mjs +80 -0
- package/kits/hub-game/scripts/test-action-observers.mjs +46 -0
- package/kits/hub-game/scripts/test-actions-client.mjs +853 -0
- package/kits/hub-game/scripts/test-actions.mjs +298 -0
- package/kits/hub-game/scripts/test-actor-budget.mjs +44 -0
- package/kits/hub-game/scripts/test-actors.mjs +38 -23
- package/kits/hub-game/scripts/test-analytics.mjs +76 -0
- package/kits/hub-game/scripts/test-anonymous-entry.mjs +28 -0
- package/kits/hub-game/scripts/test-arrival-pose-server.mjs +196 -0
- package/kits/hub-game/scripts/test-arrival-pose.mjs +24 -0
- package/kits/hub-game/scripts/test-ask-client.mjs +358 -0
- package/kits/hub-game/scripts/test-ask-slot.mjs +85 -0
- package/kits/hub-game/scripts/test-ask.mjs +269 -0
- package/kits/hub-game/scripts/test-attention.mjs +10 -1
- package/kits/hub-game/scripts/test-avatar-cap.mjs +379 -0
- package/kits/hub-game/scripts/test-avatar-colors.mjs +72 -0
- package/kits/hub-game/scripts/test-avatar-models.mjs +181 -0
- package/kits/hub-game/scripts/test-avatar-share.mjs +318 -0
- package/kits/hub-game/scripts/test-avatar-wire.mjs +792 -0
- package/kits/hub-game/scripts/test-avatar.mjs +584 -7
- package/kits/hub-game/scripts/test-back-visibility.mjs +82 -0
- package/kits/hub-game/scripts/test-ballot.mjs +1008 -0
- package/kits/hub-game/scripts/test-ban-join.mjs +121 -13
- package/kits/hub-game/scripts/test-build.mjs +49 -0
- package/kits/hub-game/scripts/test-cells.mjs +71 -0
- package/kits/hub-game/scripts/test-chat.mjs +863 -0
- package/kits/hub-game/scripts/test-classic.mjs +2 -0
- package/kits/hub-game/scripts/test-companion-chat.mjs +216 -0
- package/kits/hub-game/scripts/test-companion-client.mjs +1167 -0
- package/kits/hub-game/scripts/test-companion.mjs +259 -0
- package/kits/hub-game/scripts/test-control-layout-dom.mjs +120 -0
- package/kits/hub-game/scripts/test-crowd-names.mjs +205 -0
- package/kits/hub-game/scripts/test-decor-client.mjs +344 -0
- package/kits/hub-game/scripts/test-decor.mjs +464 -0
- package/kits/hub-game/scripts/test-default-environment-root.mjs +95 -0
- package/kits/hub-game/scripts/test-default-environment.mjs +267 -0
- package/kits/hub-game/scripts/test-door-analytics.mjs +58 -0
- package/kits/hub-game/scripts/test-door-jump.mjs +100 -0
- package/kits/hub-game/scripts/test-earned-client.mjs +459 -0
- package/kits/hub-game/scripts/test-earned.mjs +1224 -0
- package/kits/hub-game/scripts/test-emote-bubble.mjs +110 -0
- package/kits/hub-game/scripts/test-far-avatars.mjs +340 -0
- package/kits/hub-game/scripts/test-fps-telemetry.mjs +112 -0
- package/kits/hub-game/scripts/test-frame-batch.mjs +252 -0
- package/kits/hub-game/scripts/test-fresh-friends.mjs +118 -0
- package/kits/hub-game/scripts/test-friend-bests.mjs +435 -0
- package/kits/hub-game/scripts/test-grab-orbit.mjs +961 -0
- package/kits/hub-game/scripts/test-grab.mjs +7 -0
- package/kits/hub-game/scripts/test-hats.mjs +422 -168
- package/kits/hub-game/scripts/test-high-only.mjs +170 -0
- package/kits/hub-game/scripts/test-hub-leaving.mjs +203 -0
- package/kits/hub-game/scripts/test-hub-ops.mjs +758 -2
- package/kits/hub-game/scripts/test-hub-trip.mjs +1594 -12
- package/kits/hub-game/scripts/test-hud-clear.mjs +484 -57
- package/kits/hub-game/scripts/test-hud-defects-dom.mjs +100 -0
- package/kits/hub-game/scripts/test-hud-rate.mjs +224 -0
- package/kits/hub-game/scripts/test-hud-safe-visibility-dom.mjs +83 -0
- package/kits/hub-game/scripts/test-idle.mjs +427 -1
- package/kits/hub-game/scripts/test-interest-cap.mjs +36 -0
- package/kits/hub-game/scripts/test-interest-cells.mjs +513 -0
- package/kits/hub-game/scripts/test-interest-client.mjs +118 -0
- package/kits/hub-game/scripts/test-interest.mjs +15 -0
- package/kits/hub-game/scripts/test-invites-client.mjs +430 -0
- package/kits/hub-game/scripts/test-invites.mjs +109 -0
- package/kits/hub-game/scripts/test-keys.mjs +46 -1
- package/kits/hub-game/scripts/test-labels.mjs +664 -0
- package/kits/hub-game/scripts/test-landscape-layout.mjs +194 -0
- package/kits/hub-game/scripts/test-list-scroll-dom.mjs +49 -0
- package/kits/hub-game/scripts/test-load-abandon.mjs +246 -0
- package/kits/hub-game/scripts/test-loading-cover.mjs +162 -0
- package/kits/hub-game/scripts/test-manifest.mjs +472 -0
- package/kits/hub-game/scripts/test-menu-client.mjs +585 -0
- package/kits/hub-game/scripts/test-menu.mjs +319 -0
- package/kits/hub-game/scripts/test-npcs.mjs +2528 -13
- package/kits/hub-game/scripts/test-object-entry.mjs +76 -0
- package/kits/hub-game/scripts/test-observed.mjs +745 -0
- package/kits/hub-game/scripts/test-pack.mjs +7 -0
- package/kits/hub-game/scripts/test-pad-cues.mjs +304 -0
- package/kits/hub-game/scripts/test-pad-occupancy.mjs +177 -0
- package/kits/hub-game/scripts/test-picker.mjs +541 -0
- package/kits/hub-game/scripts/test-placement-cache.mjs +690 -0
- package/kits/hub-game/scripts/test-progress-reset.mjs +559 -0
- package/kits/hub-game/scripts/test-push-visit.mjs +26 -0
- package/kits/hub-game/scripts/test-quality.mjs +385 -0
- package/kits/hub-game/scripts/test-rehello.mjs +1733 -0
- package/kits/hub-game/scripts/test-relations-among.mjs +222 -0
- package/kits/hub-game/scripts/test-relations-refresh.mjs +188 -0
- package/kits/hub-game/scripts/test-resume-action-order.mjs +598 -0
- package/kits/hub-game/scripts/test-resume-held.mjs +239 -0
- package/kits/hub-game/scripts/test-resume-pose.mjs +142 -0
- package/kits/hub-game/scripts/test-safe-events-dom.mjs +116 -0
- package/kits/hub-game/scripts/test-safe-layout.mjs +330 -0
- package/kits/hub-game/scripts/test-say.mjs +1 -1
- package/kits/hub-game/scripts/test-shot.mjs +901 -0
- package/kits/hub-game/scripts/test-signin-client.mjs +45 -0
- package/kits/hub-game/scripts/test-soundscape.mjs +5437 -0
- package/kits/hub-game/scripts/test-spin.mjs +314 -0
- package/kits/hub-game/scripts/test-standing.mjs +449 -0
- package/kits/hub-game/scripts/test-storage-limit.mjs +333 -0
- package/kits/hub-game/scripts/test-stuck.mjs +1904 -0
- package/kits/hub-game/scripts/test-talk-overlay-dom.mjs +130 -0
- package/kits/hub-game/scripts/test-tier-cells.mjs +706 -0
- package/kits/hub-game/scripts/test-tiers-render.mjs +412 -0
- package/kits/hub-game/scripts/test-tiers.mjs +476 -2
- package/kits/hub-game/scripts/test-toast-band.mjs +61 -0
- package/kits/hub-game/scripts/test-try-on.mjs +22 -22
- package/kits/hub-game/scripts/test-vis.mjs +770 -0
- package/kits/hub-game/scripts/test-visibility.mjs +134 -0
- package/kits/hub-game/scripts/test-weakest-tier.mjs +924 -0
- package/kits/hub-game/scripts/test-world-labels.mjs +367 -0
- package/kits/hub-game/scripts/test-yours-chrome.mjs +210 -0
- package/kits/hub-game/scripts/test-yours.mjs +403 -0
- package/kits/multiplayer-3d/CLAUDE.md +50 -0
- package/kits/multiplayer-3d/castle.json +5 -5
- package/kits/multiplayer-3d/code/client/avatars.js +7 -0
- package/kits/multiplayer-3d/code/client/gait.js +65 -0
- package/kits/multiplayer-3d/code/client/joinFailure.js +27 -0
- package/kits/multiplayer-3d/code/client/nameTags.js +59 -4
- package/kits/multiplayer-3d/code/client/resumeGate.js +139 -0
- package/kits/multiplayer-3d/code/options.js +5 -0
- package/kits/multiplayer-3d/code/server/ownership.js +10 -2
- package/kits/multiplayer-3d/code/server/sceneBodies.js +12 -0
- package/kits/multiplayer-3d/code/server/world.js +7 -0
- package/kits/multiplayer-3d/code/systems/multiplayer.js +443 -34
- package/kits/multiplayer-3d/package-lock.json +8 -1
- package/kits/multiplayer-3d/package.json +3 -1
- package/kits/multiplayer-3d/scripts/fixtures/README.md +11 -0
- package/kits/multiplayer-3d/scripts/fixtures/ownership-legacy.json +2 -0
- package/kits/multiplayer-3d/scripts/ownership-harness.mjs +102 -0
- package/kits/multiplayer-3d/scripts/ownership-loader.mjs +46 -0
- package/kits/multiplayer-3d/scripts/ownership-worker.mjs +15 -0
- package/kits/multiplayer-3d/scripts/record-ownership-session.mjs +98 -0
- package/kits/multiplayer-3d/scripts/test-eligible-claims.mjs +167 -0
- package/kits/multiplayer-3d/scripts/test-join-watchdog.mjs +436 -0
- package/kits/multiplayer-3d/scripts/test-own-name-tag.mjs +247 -0
- package/kits/multiplayer-3d/scripts/test-resume-gate.mjs +624 -0
- package/kits/physics-2d/CLAUDE.md +19 -1
- package/kits/physics-2d/castle.json +2 -2
- package/kits/physics-2d/engine/frozenActors.js +233 -0
- package/kits/physics-2d/engine/scene.js +337 -3
- package/kits/physics-2d/engine/skyKey.js +129 -0
- package/kits/physics-2d/engine/stillClock.js +106 -0
- package/kits/physics-2d/engine/updateBudget.js +21 -0
- package/kits/physics-2d/eslint.config.js +1 -1
- package/kits/physics-2d/play/behaviors/AnalogStick.js +198 -0
- package/kits/physics-2d/play/behaviors/Camera.js +40 -0
- package/kits/physics-2d/play/behaviors/Collider.js +122 -0
- package/kits/physics-2d/play/behaviors/Draggable.js +115 -0
- package/kits/physics-2d/play/behaviors/Goal.js +46 -0
- package/kits/physics-2d/play/behaviors/Joints.js +126 -0
- package/kits/physics-2d/play/behaviors/Layout.js +71 -0
- package/kits/physics-2d/play/behaviors/RigidBody.js +57 -0
- package/kits/physics-2d/play/behaviors/Slingshot.js +142 -0
- package/kits/physics-2d/play/behaviors/SoundPlayer.js +263 -0
- package/kits/physics-2d/play/behaviors/Sprite.js +406 -0
- package/kits/physics-2d/play/behaviors/Style.js +209 -0
- package/kits/physics-2d/play/behaviors/Text.js +85 -0
- package/kits/physics-2d/play/behaviors/Video.js +93 -0
- package/kits/physics-2d/scripts/test-skip-unchanged.mjs +326 -1
- package/kits/physics-3d/CLAUDE.md +42 -529
- package/kits/physics-3d/behaviors/Body.jsx +3 -0
- package/kits/physics-3d/behaviors/Model.jsx +3 -0
- package/kits/physics-3d/behaviors/Player.jsx +661 -87
- package/kits/physics-3d/behaviors/Shape.jsx +3 -0
- package/kits/physics-3d/behaviors/Solid.jsx +3 -0
- package/kits/physics-3d/behaviors/Transform.jsx +3 -0
- package/kits/physics-3d/castle.json +3 -3
- package/kits/physics-3d/docs/engine-camera.md +542 -0
- package/kits/physics-3d/docs/engine-frame-cap.md +136 -0
- package/kits/physics-3d/docs/engine-load.md +149 -0
- package/kits/physics-3d/docs/engine-look.md +114 -0
- package/kits/physics-3d/docs/engine-shadows.md +372 -0
- package/kits/physics-3d/docs/engine-skip-work.md +187 -0
- package/kits/physics-3d/docs/engine-sky.md +198 -0
- package/kits/physics-3d/docs/engine-static-actors.md +226 -0
- package/kits/physics-3d/docs/engine-view.md +37 -0
- package/kits/physics-3d/docs/pxmodel-format.md +9 -1
- package/kits/physics-3d/engine3d/PlayOnly3D.jsx +5 -1
- package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +19 -277
- package/kits/physics-3d/engine3d/actornode.js +87 -0
- package/kits/physics-3d/engine3d/animationBudget.js +23 -0
- package/kits/physics-3d/engine3d/branches.js +3 -13
- package/kits/physics-3d/engine3d/cage.js +2 -7
- package/kits/physics-3d/engine3d/cageops.js +2 -17
- package/kits/physics-3d/engine3d/dataBehaviors.js +12 -0
- package/kits/physics-3d/engine3d/editorWorld.js +6 -0
- package/kits/physics-3d/engine3d/emptynodes.js +232 -0
- package/kits/physics-3d/engine3d/framecap.js +99 -0
- package/kits/physics-3d/engine3d/frozenphysics.js +140 -0
- package/kits/physics-3d/engine3d/frozenstatics.js +273 -0
- package/kits/physics-3d/engine3d/gait.js +126 -0
- package/kits/physics-3d/engine3d/initialModelFiles.js +18 -0
- package/kits/physics-3d/engine3d/kithooks.js +47 -0
- package/kits/physics-3d/engine3d/look.js +514 -48
- package/kits/physics-3d/engine3d/lookbake.js +208 -0
- package/kits/physics-3d/engine3d/materialpresets.js +2 -0
- package/kits/physics-3d/engine3d/modelFiles.js +3 -17
- package/kits/physics-3d/engine3d/modelMath.js +49 -0
- package/kits/physics-3d/engine3d/modelready.js +16 -0
- package/kits/physics-3d/engine3d/motion.js +39 -10
- package/kits/physics-3d/engine3d/nearshadows.js +106 -21
- package/kits/physics-3d/engine3d/optimize.js +9 -5
- package/kits/physics-3d/engine3d/orbitinput.js +522 -10
- package/kits/physics-3d/engine3d/orbitlens.js +48 -0
- package/kits/physics-3d/engine3d/ownmodel.js +213 -0
- package/kits/physics-3d/engine3d/partgeometry.js +1 -16
- package/kits/physics-3d/engine3d/paths.js +1 -9
- package/kits/physics-3d/engine3d/playTimings.js +50 -0
- package/kits/physics-3d/engine3d/playerRun.js +372 -0
- package/kits/physics-3d/engine3d/pxmodel.js +42 -11
- package/kits/physics-3d/engine3d/rapier.js +27 -0
- package/kits/physics-3d/engine3d/scatter.js +1 -11
- package/kits/physics-3d/engine3d/shadowfade.js +890 -0
- package/kits/physics-3d/engine3d/sky.js +547 -0
- package/kits/physics-3d/engine3d/skylife.js +306 -0
- package/kits/physics-3d/engine3d/squarefirst.js +177 -0
- package/kits/physics-3d/engine3d/stillshadows.js +399 -0
- package/kits/physics-3d/engine3d/sweep.js +1 -25
- package/kits/physics-3d/engine3d/unchanged.js +11 -0
- package/kits/physics-3d/engine3d/viewrange.js +52 -0
- package/kits/physics-3d/engine3d/world3d.js +1253 -76
- package/kits/physics-3d/eslint.config.js +2 -1
- package/kits/physics-3d/main.jsx +10 -2
- package/kits/physics-3d/package-lock.json +7 -0
- package/kits/physics-3d/package.json +5 -1
- package/kits/physics-3d/play/behaviors/Body.js +31 -0
- package/kits/physics-3d/play/behaviors/Door.js +37 -0
- package/kits/physics-3d/play/behaviors/Lookable.js +16 -0
- package/kits/physics-3d/play/behaviors/Model.js +23 -0
- package/kits/physics-3d/play/behaviors/Pickup.js +46 -0
- package/kits/physics-3d/play/behaviors/Player.js +1204 -0
- package/kits/physics-3d/play/behaviors/Shape.js +47 -0
- package/kits/physics-3d/play/behaviors/Solid.js +16 -0
- package/kits/physics-3d/play/behaviors/Transform.js +29 -0
- package/kits/physics-3d/pnpm-lock.yaml +8 -0
- package/kits/physics-3d/scripts/bench-shadow-fade.mjs +37 -0
- package/kits/physics-3d/scripts/build-rapier-gz.mjs +56 -0
- package/kits/physics-3d/scripts/frozen-statics-fixture.mjs +141 -0
- package/kits/physics-3d/scripts/look-baseline.mjs +155 -0
- package/kits/physics-3d/scripts/test-camera-follow.mjs +5 -1
- package/kits/physics-3d/scripts/test-camera-orbit.mjs +2613 -82
- package/kits/physics-3d/scripts/test-drop-empty-parts.mjs +2 -2
- package/kits/physics-3d/scripts/test-empty-gait-hints.mjs +89 -0
- package/kits/physics-3d/scripts/test-frame-cap-bob.mjs +438 -0
- package/kits/physics-3d/scripts/test-frame-cap.mjs +452 -0
- package/kits/physics-3d/scripts/test-frozen-nested.mjs +49 -0
- package/kits/physics-3d/scripts/test-frozen-statics-legacy-physics2d.mjs +123 -0
- package/kits/physics-3d/scripts/test-frozen-statics.mjs +434 -0
- package/kits/physics-3d/scripts/test-gait.mjs +387 -0
- package/kits/physics-3d/scripts/test-look-bake.mjs +1056 -0
- package/kits/physics-3d/scripts/test-model-parse-cache.mjs +92 -0
- package/kits/physics-3d/scripts/test-near-shadows.mjs +5 -2
- package/kits/physics-3d/scripts/test-orbit-shadow-fade.mjs +2001 -0
- package/kits/physics-3d/scripts/test-orbit-shift-lock.mjs +582 -0
- package/kits/physics-3d/scripts/test-orbit-shot.mjs +657 -0
- package/kits/physics-3d/scripts/test-orbit-view.mjs +230 -0
- package/kits/physics-3d/scripts/test-rapier-gz.mjs +106 -0
- package/kits/physics-3d/scripts/test-skip-empty-nodes.mjs +845 -0
- package/kits/physics-3d/scripts/test-sky.mjs +2470 -0
- package/kits/physics-3d/scripts/test-square-first.mjs +921 -0
- package/kits/physics-3d/scripts/test-static-actors.mjs +10 -1
- package/kits/physics-3d/scripts/test-static-physics.mjs +4 -1
- package/kits/physics-3d/scripts/test-static-scenery.mjs +2174 -0
- package/kits/physics-3d/scripts/test-steady-hover.mjs +7 -2
- package/kits/physics-3d/scripts/test-still-shadows.mjs +477 -0
- package/kits/physics-3d/scripts/test-view-range.mjs +260 -0
- package/kits/physics-3d/systems/physics3d.js +419 -9
- package/kits/real-time/castle.json +2 -2
- package/kits/real-time/code/client/connection.js +33 -10
- package/kits/real-time/code/client/gameHooks.js +2 -0
- package/kits/real-time/code/client/joinOverlay.js +9 -4
- package/kits/real-time/code/server/gameHooks.js +7 -0
- package/kits/real-time/code/server/session.js +102 -22
- package/kits/real-time/package-lock.json +1 -1
- package/package.json +2 -2
- package/dist/shell/assets/index-Cf61cNfT.css +0 -1
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
// Writes the kit's
|
|
2
|
-
// `avatar-
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
1
|
+
// Writes the kit's sixteen player avatars, `models/avatar-0.pxmodel` to
|
|
2
|
+
// `avatar-15.pxmodel`, in the hub's toon style: the Castle mascot, Petal, Beat
|
|
3
|
+
// and Star, then (v1.51) Biscuit, Mochi, Hop, Pip, Ribbit, Ember, Bolt, Gloop,
|
|
4
|
+
// Cap, Toast, Scoop and Zest. It also writes `code/client/avatarFaces.js`, each
|
|
5
|
+
// character's name and the small face the picker shows for it. Run from the
|
|
6
|
+
// kit: `node scripts/gen-avatars.mjs` (or with a directory to write everything
|
|
7
|
+
// into instead). The model files and the faces are this script's output;
|
|
8
|
+
// change a character here and run it again (scripts/test-avatar.mjs holds the
|
|
9
|
+
// files to it).
|
|
6
10
|
//
|
|
7
11
|
// What every avatar keeps, because the kit and the phone budget depend on it:
|
|
8
12
|
// - part ids `torso`, `head`, `legL`, `legR`, `armL`, `armR` (the walk moves
|
|
@@ -11,7 +15,13 @@
|
|
|
11
15
|
// batches (torso, head, two legs, two arms) plus an outline on the torso and
|
|
12
16
|
// the head only. The limbs are ink-coloured and unoutlined, since an outline
|
|
13
17
|
// on each would be four more draw calls;
|
|
14
|
-
// - flat colours: no textures and no glow
|
|
18
|
+
// - flat colours: no textures and no glow;
|
|
19
|
+
// - a crown a hat can sit on: rounded or flat, with ears, horns, stalks and
|
|
20
|
+
// leaves beside or behind it. Each avatar's height and hat fit, measured on
|
|
21
|
+
// its model, are in `code/client/avatar.js` (`TOPS`, `HAT_FITS`);
|
|
22
|
+
// - no part under 3.5 cm in radius on the torso or the head (the engine
|
|
23
|
+
// outlines those apart, a draw call more), and no part called `tail`,
|
|
24
|
+
// `wingL` or `wingR` (the engine moves those by name, each in its own batch).
|
|
15
25
|
|
|
16
26
|
import fs from 'node:fs';
|
|
17
27
|
import path from 'node:path';
|
|
@@ -19,6 +29,10 @@ import { fileURLToPath } from 'node:url';
|
|
|
19
29
|
|
|
20
30
|
const KIT_DIR = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
|
21
31
|
const OUT_DIR = process.argv[2] ? path.resolve(process.argv[2]) : path.join(KIT_DIR, 'models');
|
|
32
|
+
const FACES_FILE = path.join(
|
|
33
|
+
process.argv[2] ? OUT_DIR : path.join(KIT_DIR, 'code', 'client'),
|
|
34
|
+
'avatarFaces.js',
|
|
35
|
+
);
|
|
22
36
|
|
|
23
37
|
const INK = '#241a2e';
|
|
24
38
|
const WHITE = '#ffffff';
|
|
@@ -156,7 +170,7 @@ function onHead({ radius, scale }, x, y, lift = 0) {
|
|
|
156
170
|
// A round patch lying on the face, +z before `at` turns it: an eye, a glint,
|
|
157
171
|
// a cheek. A squashed sphere, not a disc: a disc's outline hull shows as a
|
|
158
172
|
// ring round it, while a sphere's only thickens its edge.
|
|
159
|
-
function patch(id, at, { r, wide = 1, tall = 1, segments = 6, mirror = true }, color) {
|
|
173
|
+
function patch(id, at, { r, wide = 1, tall = 1, deep = 0.3, segments = 6, mirror = true }, color) {
|
|
160
174
|
const part = {
|
|
161
175
|
id,
|
|
162
176
|
parent: 'head',
|
|
@@ -164,7 +178,7 @@ function patch(id, at, { r, wide = 1, tall = 1, segments = 6, mirror = true }, c
|
|
|
164
178
|
radius: r,
|
|
165
179
|
position: at.position,
|
|
166
180
|
rotation: at.rotation,
|
|
167
|
-
scale: [wide, tall,
|
|
181
|
+
scale: [wide, tall, deep],
|
|
168
182
|
segments,
|
|
169
183
|
};
|
|
170
184
|
if (mirror) {
|
|
@@ -175,12 +189,12 @@ function patch(id, at, { r, wide = 1, tall = 1, segments = 6, mirror = true }, c
|
|
|
175
189
|
|
|
176
190
|
// Two ink ovals with a white glint each. `at(x, y, lift)` places a point on
|
|
177
191
|
// the face.
|
|
178
|
-
function eyes(at, { x, y, r, wide = 1, tall = 1, glint = 0.036 }) {
|
|
192
|
+
function eyes(at, { x, y, r, wide = 1, tall = 1, glint = 0.036, lift = 0 }) {
|
|
179
193
|
return [
|
|
180
|
-
patch('eye', at(x, y,
|
|
194
|
+
patch('eye', at(x, y, lift), { r, wide, tall, segments: 8 }, INK),
|
|
181
195
|
patch(
|
|
182
196
|
'glint',
|
|
183
|
-
at(x + r * wide * 0.3, y + r * tall * 0.4, r * 0.3),
|
|
197
|
+
at(x + r * wide * 0.3, y + r * tall * 0.4, lift + r * 0.3),
|
|
184
198
|
{ r: glint, segments: 4 },
|
|
185
199
|
WHITE,
|
|
186
200
|
),
|
|
@@ -199,6 +213,19 @@ function starOutline(count, outer, inner) {
|
|
|
199
213
|
return points;
|
|
200
214
|
}
|
|
201
215
|
|
|
216
|
+
// A character's face for the picker: the inside of a 24 x 24 SVG, drawn in
|
|
217
|
+
// the character's own colours with the ink line (`write` adds the rest).
|
|
218
|
+
// Two ink dots for eyes, unless a face draws its own.
|
|
219
|
+
function dots(y, x = 2.6, r = 1.5) {
|
|
220
|
+
return `<g fill="${INK}" stroke="none"><circle cx="${12 - x}" cy="${y}" r="${r}"/><circle cx="${12 + x}" cy="${y}" r="${r}"/></g>`;
|
|
221
|
+
}
|
|
222
|
+
const disc = (cx, cy, r, fill, more = '') =>
|
|
223
|
+
`<circle cx="${cx}" cy="${cy}" r="${r}" fill="${fill}"${more}/>`;
|
|
224
|
+
const oval = (cx, cy, rx, ry, fill) =>
|
|
225
|
+
`<ellipse cx="${cx}" cy="${cy}" rx="${rx}" ry="${ry}" fill="${fill}"/>`;
|
|
226
|
+
const shape = (d, fill, more = '') => `<path d="${d}" fill="${fill}"${more}/>`;
|
|
227
|
+
const BARE = ' stroke="none"';
|
|
228
|
+
|
|
202
229
|
//
|
|
203
230
|
// 0: the Castle mascot. One black body rounded on top, one almond eye, and
|
|
204
231
|
// the logo's white sheen down its side.
|
|
@@ -316,7 +343,13 @@ function mascot() {
|
|
|
316
343
|
patch('pupil', flatOn(0, 0, -0.01), { r: 0.108, segments: 10, mirror: false }, INK),
|
|
317
344
|
patch('glint', flatOn(0.042, 0.046, 0.016), { r: 0.038, mirror: false }, WHITE),
|
|
318
345
|
);
|
|
319
|
-
|
|
346
|
+
const icon = [
|
|
347
|
+
shape('M5 22V10a7 7 0 0 1 14 0v12z', '#4a4556'),
|
|
348
|
+
shape('M7.2 19.5V10a4.8 4.8 0 0 1 1.6-3.6', 'none', ` stroke="${WHITE}"`),
|
|
349
|
+
shape('M7.6 13.4q4.4-4.6 8.8 0q-4.4 4.6-8.8 0z', WHITE),
|
|
350
|
+
disc(12, 13.4, 1.8, INK, BARE),
|
|
351
|
+
];
|
|
352
|
+
return { name: 'Castle', look: { ...LOOK, outlineColor: MASCOT_LINE }, parts, icon };
|
|
320
353
|
}
|
|
321
354
|
|
|
322
355
|
//
|
|
@@ -412,7 +445,11 @@ function petal() {
|
|
|
412
445
|
),
|
|
413
446
|
);
|
|
414
447
|
parts.find((part) => part.id === 'mouth').rotation[2] = 180;
|
|
415
|
-
|
|
448
|
+
const icon = [0, 60, 120, 180, 240, 300].map((turn) =>
|
|
449
|
+
disc(round(12 + 6.6 * Math.sin(rad(turn))), round(12 - 6.6 * Math.cos(rad(turn))), 4, pink),
|
|
450
|
+
);
|
|
451
|
+
icon.push(disc(12, 12, 6.4, '#fff1cf'), dots(12));
|
|
452
|
+
return { name: 'Petal', parts, icon };
|
|
416
453
|
}
|
|
417
454
|
|
|
418
455
|
//
|
|
@@ -512,7 +549,14 @@ function beat() {
|
|
|
512
549
|
),
|
|
513
550
|
patch('tongue', at(0, -0.118, 0.012), { r: 0.045, tall: 0.5, mirror: false }, '#ff5fa2'),
|
|
514
551
|
);
|
|
515
|
-
|
|
552
|
+
const icon = [
|
|
553
|
+
shape('M4 13a8 8 0 0 1 16 0', 'none', ' stroke-width="2.2"'),
|
|
554
|
+
disc(12, 14, 7.5, '#38b6ff'),
|
|
555
|
+
oval(3.6, 14.5, 2, 3.4, orange),
|
|
556
|
+
oval(20.4, 14.5, 2, 3.4, orange),
|
|
557
|
+
dots(13.5),
|
|
558
|
+
];
|
|
559
|
+
return { name: 'Beat', parts, icon };
|
|
516
560
|
}
|
|
517
561
|
|
|
518
562
|
//
|
|
@@ -572,7 +616,847 @@ function star() {
|
|
|
572
616
|
orange,
|
|
573
617
|
),
|
|
574
618
|
);
|
|
575
|
-
|
|
619
|
+
const icon = [
|
|
620
|
+
shape(
|
|
621
|
+
'M12 1.5l3 6.6 7.2.8-5.4 4.9 1.5 7.1L12 17.3l-6.3 3.6 1.5-7.1L1.8 8.9l7.2-.8z',
|
|
622
|
+
'#ffd21f',
|
|
623
|
+
),
|
|
624
|
+
dots(11.5, 2.2, 1.3),
|
|
625
|
+
];
|
|
626
|
+
return { name: 'Star', parts, icon };
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
//
|
|
630
|
+
// Shared by the twelve after Star.
|
|
631
|
+
//
|
|
632
|
+
|
|
633
|
+
// The usual body: a rounded lathe from the hips to the neck.
|
|
634
|
+
const BODY = [
|
|
635
|
+
[0, -0.07],
|
|
636
|
+
[0.19, -0.02],
|
|
637
|
+
[0.24, 0.12],
|
|
638
|
+
[0.2, 0.28],
|
|
639
|
+
[0.12, 0.39],
|
|
640
|
+
[0, 0.42],
|
|
641
|
+
];
|
|
642
|
+
|
|
643
|
+
// A part hung on another, coloured.
|
|
644
|
+
function on(parent, id, kind, color, fields) {
|
|
645
|
+
return mat({ id, parent, kind, ...fields }, color);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
function ball(parent, id, color, radius, position, { scale, rotation, segments = 6, mirror } = {}) {
|
|
649
|
+
const part = { id, parent, kind: 'sphere', radius, position: position.map(round), segments };
|
|
650
|
+
if (scale) {
|
|
651
|
+
part.scale = scale;
|
|
652
|
+
}
|
|
653
|
+
if (rotation) {
|
|
654
|
+
part.rotation = rotation;
|
|
655
|
+
}
|
|
656
|
+
if (mirror) {
|
|
657
|
+
part.mirror = 'x';
|
|
658
|
+
}
|
|
659
|
+
return mat(part, color);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
function cone(
|
|
663
|
+
parent,
|
|
664
|
+
id,
|
|
665
|
+
color,
|
|
666
|
+
radius,
|
|
667
|
+
height,
|
|
668
|
+
position,
|
|
669
|
+
rotation,
|
|
670
|
+
{ segments = 5, scale, mirror } = {},
|
|
671
|
+
) {
|
|
672
|
+
const part = {
|
|
673
|
+
id,
|
|
674
|
+
parent,
|
|
675
|
+
kind: 'cone',
|
|
676
|
+
radius,
|
|
677
|
+
height,
|
|
678
|
+
position: position.map(round),
|
|
679
|
+
rotation,
|
|
680
|
+
segments,
|
|
681
|
+
};
|
|
682
|
+
if (scale) {
|
|
683
|
+
part.scale = scale;
|
|
684
|
+
}
|
|
685
|
+
if (mirror) {
|
|
686
|
+
part.mirror = 'x';
|
|
687
|
+
}
|
|
688
|
+
return mat(part, color);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
function roundHead(spec, y, color, segments = 10) {
|
|
692
|
+
return mat(
|
|
693
|
+
{ id: 'head', parent: 'torso', kind: 'sphere', position: [0, y, 0], ...spec, segments },
|
|
694
|
+
color,
|
|
695
|
+
);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
// `onHead` for a ball that is not at the head's pivot: a face mask, a snout.
|
|
699
|
+
function onBall(center, spec) {
|
|
700
|
+
return (x, y, lift) => {
|
|
701
|
+
const at = onHead(spec, x - center[0], y - center[1], lift);
|
|
702
|
+
return { position: at.position.map((v, k) => round(v + center[k])), rotation: at.rotation };
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// `onHead` for a head that is a lathe: the point of its surface in front of
|
|
707
|
+
// [x, y] (behind it with `back`), pushed `lift` along the normal.
|
|
708
|
+
function onLathe(profile) {
|
|
709
|
+
return (x, y, lift = 0, back = false) => {
|
|
710
|
+
let k = 0;
|
|
711
|
+
while (k < profile.length - 2 && profile[k + 1][1] < y) {
|
|
712
|
+
k += 1;
|
|
713
|
+
}
|
|
714
|
+
const [r0, y0] = profile[k];
|
|
715
|
+
const [r1, y1] = profile[k + 1];
|
|
716
|
+
const r = r0 + ((r1 - r0) * (y - y0)) / (y1 - y0);
|
|
717
|
+
const side = back ? -1 : 1;
|
|
718
|
+
const z = side * Math.sqrt(Math.max(0, r * r - x * x));
|
|
719
|
+
// Outward, and up where the profile narrows upward.
|
|
720
|
+
const slope = Math.atan2(r0 - r1, y1 - y0);
|
|
721
|
+
const normal = [(Math.cos(slope) * x) / r, Math.sin(slope), (Math.cos(slope) * z) / r];
|
|
722
|
+
return {
|
|
723
|
+
position: [
|
|
724
|
+
round(x + normal[0] * lift),
|
|
725
|
+
round(y + normal[1] * lift),
|
|
726
|
+
round(z + normal[2] * lift),
|
|
727
|
+
],
|
|
728
|
+
rotation: [
|
|
729
|
+
round(-deg(Math.asin(normal[1])) * side),
|
|
730
|
+
round(deg(Math.atan2(normal[0], normal[2]))),
|
|
731
|
+
0,
|
|
732
|
+
],
|
|
733
|
+
};
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// A smile: half a thin ring, lying on the face at `at`.
|
|
738
|
+
function smile(at, radius = 0.045, tube = 0.016) {
|
|
739
|
+
const part = mat(
|
|
740
|
+
{ id: 'mouth', parent: 'head', kind: 'torus', radius, tube, arc: 180, ...at, segments: 6 },
|
|
741
|
+
INK,
|
|
742
|
+
);
|
|
743
|
+
part.rotation[2] = 180;
|
|
744
|
+
return part;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
function cheeks(at, color, r = 0.046) {
|
|
748
|
+
return patch('cheek', at, { r, tall: 0.7, segments: 5 }, color);
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
//
|
|
752
|
+
// 4: Biscuit, a puppy.
|
|
753
|
+
//
|
|
754
|
+
|
|
755
|
+
function biscuit() {
|
|
756
|
+
const tan = '#c79a68';
|
|
757
|
+
const brown = '#6b3d20';
|
|
758
|
+
const cream = '#ffe6bf';
|
|
759
|
+
const head = { radius: 0.3, scale: [1.05, 0.95, 1] };
|
|
760
|
+
const at = (x, y, lift) => onHead(head, x, y, lift);
|
|
761
|
+
const muzzle = [0, -0.09, 0.2];
|
|
762
|
+
const parts = limbs({ shoe: brown });
|
|
763
|
+
parts.push(
|
|
764
|
+
torso(BODY, tan),
|
|
765
|
+
roundHead(head, 0.68, tan),
|
|
766
|
+
// The patch round one eye: a ball inside the head that breaks its surface.
|
|
767
|
+
// A patch round one eye; that eye stands on it.
|
|
768
|
+
patch('eyePatch', at(0.13, 0.05, -0.012), { r: 0.135, tall: 1.1, mirror: false }, brown),
|
|
769
|
+
patch('eyeL', at(0.115, 0.04, 0.03), { r: 0.07, tall: 1.15, segments: 8, mirror: false }, INK),
|
|
770
|
+
patch('glintL', at(0.136, 0.072, 0.052), { r: 0.036, segments: 4, mirror: false }, WHITE),
|
|
771
|
+
patch('eyeR', at(-0.115, 0.04, 0), { r: 0.07, tall: 1.15, segments: 8, mirror: false }, INK),
|
|
772
|
+
patch('glintR', at(-0.094, 0.072, 0.022), { r: 0.036, segments: 4, mirror: false }, WHITE),
|
|
773
|
+
ball('head', 'muzzle', cream, 0.135, muzzle, { scale: [1.25, 0.85, 0.9] }),
|
|
774
|
+
ball('head', 'nose', INK, 0.05, [0, -0.045, 0.325], { scale: [1.25, 0.85, 0.8] }),
|
|
775
|
+
ball('head', 'tongue', '#ff5f8f', 0.045, [0, -0.175, 0.285], {
|
|
776
|
+
scale: [0.9, 1.1, 0.5],
|
|
777
|
+
segments: 4,
|
|
778
|
+
}),
|
|
779
|
+
// Floppy ears hang down the sides, clear of the crown.
|
|
780
|
+
ball('head', 'ear', brown, 0.13, [0.305, -0.03, -0.02], {
|
|
781
|
+
scale: [0.5, 1.45, 0.85],
|
|
782
|
+
rotation: [0, 0, 10],
|
|
783
|
+
mirror: true,
|
|
784
|
+
}),
|
|
785
|
+
on('torso', 'collar', 'cylinder', '#e8463c', {
|
|
786
|
+
radius: 0.15,
|
|
787
|
+
height: 0.055,
|
|
788
|
+
position: [0, 0.385, 0],
|
|
789
|
+
segments: 8,
|
|
790
|
+
}),
|
|
791
|
+
cone('torso', 'tailA', tan, 0.06, 0.24, [0, 0.13, -0.27], [-48, 0, 0]),
|
|
792
|
+
);
|
|
793
|
+
const icon = [
|
|
794
|
+
disc(12, 13, 8, tan),
|
|
795
|
+
oval(4.3, 13.5, 2.4, 5.4, brown),
|
|
796
|
+
oval(19.7, 13.5, 2.4, 5.4, brown),
|
|
797
|
+
disc(14.8, 11.6, 3.1, brown, BARE),
|
|
798
|
+
dots(11.6),
|
|
799
|
+
oval(12, 15.6, 1.9, 1.3, INK),
|
|
800
|
+
];
|
|
801
|
+
return { name: 'Biscuit', parts, icon };
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
//
|
|
805
|
+
// 5: Mochi, a cat.
|
|
806
|
+
//
|
|
807
|
+
|
|
808
|
+
function mochi() {
|
|
809
|
+
const fur = '#686c7d';
|
|
810
|
+
const white = '#fffaf2';
|
|
811
|
+
const pink = '#ff7fae';
|
|
812
|
+
const head = { radius: 0.3, scale: [1.08, 0.92, 1] };
|
|
813
|
+
const at = (x, y, lift) => onHead(head, x, y, lift);
|
|
814
|
+
const parts = limbs({ shoe: pink });
|
|
815
|
+
parts.push(
|
|
816
|
+
torso(BODY, fur),
|
|
817
|
+
roundHead(head, 0.68, fur),
|
|
818
|
+
// Ears stand at the sides of the crown, so a hat sits between them.
|
|
819
|
+
cone('head', 'ear', fur, 0.115, 0.21, [0.215, 0.27, -0.02], [0, 0, -24], {
|
|
820
|
+
segments: 4,
|
|
821
|
+
mirror: true,
|
|
822
|
+
}),
|
|
823
|
+
cone('head', 'earIn', pink, 0.07, 0.14, [0.212, 0.262, 0.028], [0, 0, -24], {
|
|
824
|
+
segments: 4,
|
|
825
|
+
mirror: true,
|
|
826
|
+
}),
|
|
827
|
+
...eyes(at, { x: 0.12, y: 0.035, r: 0.075, wide: 0.9, tall: 1.2 }),
|
|
828
|
+
ball('head', 'muzzle', white, 0.115, [0, -0.095, 0.2], { scale: [1.3, 0.8, 0.9] }),
|
|
829
|
+
ball('head', 'nose', pink, 0.04, [0, -0.06, 0.3], { scale: [1.2, 0.8, 0.7], segments: 4 }),
|
|
830
|
+
on('head', 'whiskerA', 'cylinder', INK, {
|
|
831
|
+
radius: 0.011,
|
|
832
|
+
height: 0.17,
|
|
833
|
+
position: [0.25, -0.075, 0.2],
|
|
834
|
+
rotation: [0, 20, 80],
|
|
835
|
+
segments: 3,
|
|
836
|
+
mirror: 'x',
|
|
837
|
+
}),
|
|
838
|
+
on('head', 'whiskerB', 'cylinder', INK, {
|
|
839
|
+
radius: 0.011,
|
|
840
|
+
height: 0.17,
|
|
841
|
+
position: [0.25, -0.125, 0.2],
|
|
842
|
+
rotation: [0, 20, 100],
|
|
843
|
+
segments: 3,
|
|
844
|
+
mirror: 'x',
|
|
845
|
+
}),
|
|
846
|
+
// The tail curls up behind.
|
|
847
|
+
on('torso', 'tailA', 'torus', fur, {
|
|
848
|
+
radius: 0.12,
|
|
849
|
+
tube: 0.042,
|
|
850
|
+
arc: 230,
|
|
851
|
+
position: [0, 0.2, -0.3],
|
|
852
|
+
rotation: [0, 90, 205],
|
|
853
|
+
segments: 6,
|
|
854
|
+
}),
|
|
855
|
+
);
|
|
856
|
+
const icon = [
|
|
857
|
+
shape('M4.6 11 5.4 3l5.4 3.6zM19.4 11 18.6 3l-5.4 3.6z', fur),
|
|
858
|
+
disc(12, 14, 8, fur),
|
|
859
|
+
shape('M1.5 14.5h4M18.5 14.5h4', 'none'),
|
|
860
|
+
dots(13),
|
|
861
|
+
oval(12, 16.2, 1.3, 0.9, pink),
|
|
862
|
+
];
|
|
863
|
+
return { name: 'Mochi', parts, icon };
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
//
|
|
867
|
+
// 6: Hop, a bunny.
|
|
868
|
+
//
|
|
869
|
+
|
|
870
|
+
function hop() {
|
|
871
|
+
const white = '#fbf6ee';
|
|
872
|
+
const pink = '#ff8fb3';
|
|
873
|
+
const head = { radius: 0.29, scale: [1.04, 0.97, 1] };
|
|
874
|
+
const at = (x, y, lift) => onHead(head, x, y, lift);
|
|
875
|
+
const parts = limbs({ shoe: pink });
|
|
876
|
+
parts.push(
|
|
877
|
+
torso(BODY, white),
|
|
878
|
+
roundHead(head, 0.68, white),
|
|
879
|
+
// Two tall ears rise from the back of the crown, behind where a hat sits.
|
|
880
|
+
ball('head', 'ear', white, 0.1, [0.12, 0.37, -0.23], {
|
|
881
|
+
scale: [0.6, 2, 0.42],
|
|
882
|
+
rotation: [-8, 0, -8],
|
|
883
|
+
mirror: true,
|
|
884
|
+
}),
|
|
885
|
+
ball('head', 'earIn', pink, 0.07, [0.12, 0.37, -0.2], {
|
|
886
|
+
scale: [0.5, 2.1, 0.3],
|
|
887
|
+
rotation: [-8, 0, -8],
|
|
888
|
+
segments: 5,
|
|
889
|
+
mirror: true,
|
|
890
|
+
}),
|
|
891
|
+
...eyes(at, { x: 0.11, y: 0.035, r: 0.072, wide: 0.9, tall: 1.2 }),
|
|
892
|
+
ball('head', 'nose', pink, 0.04, at(0, -0.05, 0.002).position, {
|
|
893
|
+
scale: [1.2, 0.8, 0.6],
|
|
894
|
+
segments: 4,
|
|
895
|
+
}),
|
|
896
|
+
on('head', 'teeth', 'box', '#ffffff', {
|
|
897
|
+
size: [0.075, 0.06, 0.04],
|
|
898
|
+
position: at(0, -0.125, 0).position,
|
|
899
|
+
rotation: at(0, -0.125, 0).rotation,
|
|
900
|
+
}),
|
|
901
|
+
cheeks(at(0.2, -0.08, 0), pink),
|
|
902
|
+
ball('torso', 'tailA', white, 0.095, [0, 0.07, -0.23]),
|
|
903
|
+
);
|
|
904
|
+
const icon = [
|
|
905
|
+
oval(8.6, 6.4, 2.2, 5.4, white),
|
|
906
|
+
oval(15.4, 6.4, 2.2, 5.4, white),
|
|
907
|
+
shape('M8.6 3.5v5M15.4 3.5v5', 'none', ` stroke="${pink}" stroke-width="1.5"`),
|
|
908
|
+
disc(12, 15.5, 7, white),
|
|
909
|
+
dots(14.5),
|
|
910
|
+
oval(12, 17.4, 1.2, 0.9, pink),
|
|
911
|
+
];
|
|
912
|
+
return { name: 'Hop', parts, icon };
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
//
|
|
916
|
+
// 7: Pip, a penguin.
|
|
917
|
+
//
|
|
918
|
+
|
|
919
|
+
function pip() {
|
|
920
|
+
const navy = '#27356e';
|
|
921
|
+
const white = '#ffffff';
|
|
922
|
+
const orange = '#ff9326';
|
|
923
|
+
const head = { radius: 0.28, scale: [1.05, 0.96, 1] };
|
|
924
|
+
const mask = { radius: 0.225, scale: [1.04, 0.95, 1] };
|
|
925
|
+
const maskAt = [0, -0.035, 0.125];
|
|
926
|
+
const at = onBall(maskAt, mask);
|
|
927
|
+
const parts = limbs({ shoe: orange, mitt: navy });
|
|
928
|
+
parts.push(
|
|
929
|
+
torso(
|
|
930
|
+
[
|
|
931
|
+
[0, -0.07],
|
|
932
|
+
[0.22, -0.03],
|
|
933
|
+
[0.28, 0.12],
|
|
934
|
+
[0.24, 0.29],
|
|
935
|
+
[0.14, 0.4],
|
|
936
|
+
[0, 0.43],
|
|
937
|
+
],
|
|
938
|
+
navy,
|
|
939
|
+
),
|
|
940
|
+
ball('torso', 'belly', white, 0.21, [0, 0.14, 0.15], { scale: [1, 1.12, 0.75] }),
|
|
941
|
+
roundHead(head, 0.68, navy),
|
|
942
|
+
ball('head', 'mask', white, mask.radius, maskAt, { scale: mask.scale, segments: 10 }),
|
|
943
|
+
...eyes(at, { x: 0.1, y: 0.03, r: 0.062, tall: 1.15 }),
|
|
944
|
+
cone('head', 'beak', orange, 0.075, 0.14, [0, -0.075, 0.37], [90, 0, 0], {
|
|
945
|
+
scale: [1.25, 1, 0.7],
|
|
946
|
+
}),
|
|
947
|
+
cheeks(at(0.17, -0.07, 0), '#ff8fb3', 0.04),
|
|
948
|
+
cone('torso', 'tailA', navy, 0.07, 0.16, [0, 0.03, -0.27], [-70, 0, 0]),
|
|
949
|
+
);
|
|
950
|
+
const icon = [
|
|
951
|
+
disc(12, 12.5, 9, navy),
|
|
952
|
+
oval(12, 14, 6.4, 5.8, white),
|
|
953
|
+
dots(12.6),
|
|
954
|
+
shape('M10.3 15h3.4L12 17.8z', orange),
|
|
955
|
+
];
|
|
956
|
+
return { name: 'Pip', parts, icon };
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
//
|
|
960
|
+
// 8: Ribbit, a frog.
|
|
961
|
+
//
|
|
962
|
+
|
|
963
|
+
function ribbit() {
|
|
964
|
+
const green = '#4fbf3f';
|
|
965
|
+
const cream = '#fff3b8';
|
|
966
|
+
const head = { radius: 0.3, scale: [1.28, 0.74, 1] };
|
|
967
|
+
const at = (x, y, lift) => onHead(head, x, y, lift);
|
|
968
|
+
const bump = [0.235, 0.15, 0.05];
|
|
969
|
+
const bumpR = 0.108;
|
|
970
|
+
const eyeAt = (x, y, lift) => ({
|
|
971
|
+
position: [round(bump[0] + x), round(bump[1] + y), round(bump[2] + bumpR + lift)],
|
|
972
|
+
rotation: [0, 0, 0],
|
|
973
|
+
});
|
|
974
|
+
const parts = limbs({ shoe: green, mitt: cream });
|
|
975
|
+
parts.push(
|
|
976
|
+
torso(BODY, green),
|
|
977
|
+
ball('torso', 'belly', cream, 0.17, [0, 0.13, 0.14], { scale: [1, 1.1, 0.75], segments: 8 }),
|
|
978
|
+
roundHead(head, 0.64, green),
|
|
979
|
+
// The eyes stand on two bumps at the sides of the crown.
|
|
980
|
+
ball('head', 'bump', green, bumpR, bump, { mirror: true }),
|
|
981
|
+
patch('eye', eyeAt(0, 0.005, -0.012), { r: 0.066, segments: 8 }, INK),
|
|
982
|
+
patch('glint', eyeAt(0.02, 0.03, 0.006), { r: 0.036, segments: 4 }, WHITE),
|
|
983
|
+
// A wide mouth: an arc of a ring standing in the face.
|
|
984
|
+
on('head', 'mouth', 'torus', INK, {
|
|
985
|
+
radius: 0.16,
|
|
986
|
+
tube: 0.016,
|
|
987
|
+
arc: 120,
|
|
988
|
+
position: [0, 0.1, 0.283],
|
|
989
|
+
rotation: [0, 0, 210],
|
|
990
|
+
segments: 8,
|
|
991
|
+
}),
|
|
992
|
+
cheeks(at(0.25, -0.03, 0), '#ff8fb3'),
|
|
993
|
+
);
|
|
994
|
+
const icon = [
|
|
995
|
+
disc(6.8, 8, 3.6, green),
|
|
996
|
+
disc(17.2, 8, 3.6, green),
|
|
997
|
+
oval(12, 14.5, 10, 7, green),
|
|
998
|
+
dots(8, 5.2, 1.6),
|
|
999
|
+
shape('M7 15.5q5 4 10 0', 'none'),
|
|
1000
|
+
];
|
|
1001
|
+
return { name: 'Ribbit', parts, icon };
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
//
|
|
1005
|
+
// 9: Ember, a little dragon.
|
|
1006
|
+
//
|
|
1007
|
+
|
|
1008
|
+
function ember() {
|
|
1009
|
+
const purple = '#7a3fd0';
|
|
1010
|
+
const lilac = '#c9adf8';
|
|
1011
|
+
const flame = '#ff9a2e';
|
|
1012
|
+
const horn = '#ffe9a8';
|
|
1013
|
+
const head = { radius: 0.29, scale: [1.02, 0.95, 1] };
|
|
1014
|
+
const at = (x, y, lift) => onHead(head, x, y, lift);
|
|
1015
|
+
// The muzzle: a paler bump low on the face, nostrils on top, a mouth below.
|
|
1016
|
+
const muzzle = { radius: 0.135, scale: [1.15, 0.8, 1.1] };
|
|
1017
|
+
const muzzleAt = [0, -0.105, 0.2];
|
|
1018
|
+
const onMuzzle = onBall(muzzleAt, muzzle);
|
|
1019
|
+
const parts = limbs({ shoe: purple });
|
|
1020
|
+
parts.push(
|
|
1021
|
+
torso(BODY, purple),
|
|
1022
|
+
ball('torso', 'belly', flame, 0.17, [0, 0.13, 0.14], { scale: [0.95, 1.1, 0.75] }),
|
|
1023
|
+
roundHead(head, 0.68, purple),
|
|
1024
|
+
ball('head', 'muzzle', lilac, muzzle.radius, muzzleAt, { scale: muzzle.scale }),
|
|
1025
|
+
patch('nostril', onMuzzle(0.048, -0.045, -0.004), { r: 0.036, wide: 0.55, segments: 4 }, INK),
|
|
1026
|
+
smile(onMuzzle(0, -0.125, 0.002), 0.05, 0.014),
|
|
1027
|
+
...eyes(at, { x: 0.12, y: 0.085, r: 0.07, tall: 1.15 }),
|
|
1028
|
+
// Horns at the sides of the crown, leaning out and back.
|
|
1029
|
+
cone('head', 'horn', horn, 0.058, 0.19, [0.215, 0.27, -0.07], [-18, 0, -30], { mirror: true }),
|
|
1030
|
+
cone('head', 'spikeA', flame, 0.07, 0.16, [0, 0.13, -0.3], [-75, 0, 0]),
|
|
1031
|
+
cone('torso', 'spikeB', flame, 0.07, 0.15, [0, 0.3, -0.21], [-80, 0, 0]),
|
|
1032
|
+
cone('torso', 'tailA', purple, 0.1, 0.42, [0, 0.03, -0.33], [-105, 0, 0], { segments: 6 }),
|
|
1033
|
+
cone('torso', 'tailTip', flame, 0.085, 0.16, [0, -0.045, -0.6], [-105, 0, 0], {
|
|
1034
|
+
scale: [1, 1, 0.5],
|
|
1035
|
+
}),
|
|
1036
|
+
on('torso', 'wing', 'extrude', '#5a2aa8', {
|
|
1037
|
+
outline: [
|
|
1038
|
+
[0, 0],
|
|
1039
|
+
[0.2, 0.17],
|
|
1040
|
+
[0.21, 0.02],
|
|
1041
|
+
[0.13, 0.04],
|
|
1042
|
+
[0.11, -0.07],
|
|
1043
|
+
],
|
|
1044
|
+
depth: 0.035,
|
|
1045
|
+
flat: false,
|
|
1046
|
+
position: [0.1, 0.22, -0.2],
|
|
1047
|
+
rotation: [0, -40, 0],
|
|
1048
|
+
mirror: 'x',
|
|
1049
|
+
}),
|
|
1050
|
+
);
|
|
1051
|
+
const icon = [
|
|
1052
|
+
shape('M5.2 9.5 3.6 2.6l5.6 3.6zM18.8 9.5l1.6-6.9-5.6 3.6z', horn),
|
|
1053
|
+
shape('M12 1.8l2.2 4h-4.4z', flame),
|
|
1054
|
+
disc(12, 13.5, 8, purple),
|
|
1055
|
+
dots(11.4),
|
|
1056
|
+
oval(12, 17, 4, 2.9, lilac),
|
|
1057
|
+
dots(16, 1.3, 0.6),
|
|
1058
|
+
shape('M10.6 18.2q1.4 1 2.8 0', 'none', ' stroke-width="1"'),
|
|
1059
|
+
];
|
|
1060
|
+
return { name: 'Ember', parts, icon };
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
//
|
|
1064
|
+
// 10: Bolt, a robot.
|
|
1065
|
+
//
|
|
1066
|
+
|
|
1067
|
+
function bolt() {
|
|
1068
|
+
const steel = '#b5c1cf';
|
|
1069
|
+
const dark = '#3a4558';
|
|
1070
|
+
const yellow = '#ffc531';
|
|
1071
|
+
const cyan = '#35e0ff';
|
|
1072
|
+
const front = 0.22;
|
|
1073
|
+
const parts = limbs({ shoe: dark, mitt: yellow });
|
|
1074
|
+
parts.push(
|
|
1075
|
+
mat(
|
|
1076
|
+
{
|
|
1077
|
+
id: 'torso',
|
|
1078
|
+
kind: 'box',
|
|
1079
|
+
position: [0, HIP, 0],
|
|
1080
|
+
offset: [0, 0.17, 0],
|
|
1081
|
+
size: [0.38, 0.42, 0.28],
|
|
1082
|
+
round: 0.05,
|
|
1083
|
+
roundSegments: 1,
|
|
1084
|
+
},
|
|
1085
|
+
steel,
|
|
1086
|
+
),
|
|
1087
|
+
on('torso', 'panel', 'box', dark, { size: [0.22, 0.15, 0.03], position: [0, 0.2, 0.135] }),
|
|
1088
|
+
ball('torso', 'light', '#ff4d4d', 0.04, [-0.05, 0.215, 0.15], {
|
|
1089
|
+
scale: [1, 1, 0.5],
|
|
1090
|
+
segments: 4,
|
|
1091
|
+
}),
|
|
1092
|
+
on('torso', 'dial', 'box', yellow, {
|
|
1093
|
+
size: [0.07, 0.035, 0.03],
|
|
1094
|
+
position: [0.05, 0.215, 0.143],
|
|
1095
|
+
}),
|
|
1096
|
+
on('torso', 'neck', 'cylinder', dark, {
|
|
1097
|
+
radius: 0.075,
|
|
1098
|
+
height: 0.1,
|
|
1099
|
+
position: [0, 0.43, 0],
|
|
1100
|
+
segments: 6,
|
|
1101
|
+
}),
|
|
1102
|
+
mat(
|
|
1103
|
+
{
|
|
1104
|
+
id: 'head',
|
|
1105
|
+
parent: 'torso',
|
|
1106
|
+
kind: 'box',
|
|
1107
|
+
position: [0, 0.69, 0],
|
|
1108
|
+
size: [0.56, 0.44, 0.44],
|
|
1109
|
+
round: 0.07,
|
|
1110
|
+
roundSegments: 1,
|
|
1111
|
+
},
|
|
1112
|
+
steel,
|
|
1113
|
+
),
|
|
1114
|
+
// One visor strip, with two lights in it for eyes.
|
|
1115
|
+
on('head', 'visor', 'box', INK, {
|
|
1116
|
+
size: [0.46, 0.15, 0.04],
|
|
1117
|
+
position: [0, 0.035, front - 0.004],
|
|
1118
|
+
}),
|
|
1119
|
+
ball('head', 'eye', cyan, 0.05, [0.11, 0.035, front + 0.012], {
|
|
1120
|
+
scale: [1, 1.1, 0.4],
|
|
1121
|
+
mirror: true,
|
|
1122
|
+
}),
|
|
1123
|
+
on('head', 'mouth', 'box', INK, {
|
|
1124
|
+
size: [0.18, 0.035, 0.03],
|
|
1125
|
+
position: [0, -0.12, front - 0.006],
|
|
1126
|
+
}),
|
|
1127
|
+
on('head', 'ear', 'cylinder', yellow, {
|
|
1128
|
+
radius: 0.085,
|
|
1129
|
+
height: 0.07,
|
|
1130
|
+
position: [0.3, 0, 0],
|
|
1131
|
+
rotation: [0, 0, 90],
|
|
1132
|
+
segments: 8,
|
|
1133
|
+
mirror: 'x',
|
|
1134
|
+
}),
|
|
1135
|
+
// The antenna stands on one ear, beside the head: the crown stays flat.
|
|
1136
|
+
on('head', 'mast', 'cylinder', INK, {
|
|
1137
|
+
radius: 0.016,
|
|
1138
|
+
height: 0.24,
|
|
1139
|
+
position: [0.33, 0.17, 0],
|
|
1140
|
+
segments: 4,
|
|
1141
|
+
}),
|
|
1142
|
+
ball('head', 'bulb', '#ff4d4d', 0.05, [0.33, 0.3, 0]),
|
|
1143
|
+
);
|
|
1144
|
+
const icon = [
|
|
1145
|
+
shape('M20.5 10V4', 'none'),
|
|
1146
|
+
disc(20.5, 3.4, 1.7, '#ff4d4d'),
|
|
1147
|
+
`<rect x="3.5" y="6.5" width="16" height="14" rx="2.6" fill="${steel}"/>`,
|
|
1148
|
+
`<rect x="5.6" y="9.4" width="11.8" height="5" rx="1.2" fill="${INK}"/>`,
|
|
1149
|
+
`<g fill="${cyan}" stroke="none"><circle cx="9" cy="11.9" r="1.4"/><circle cx="14" cy="11.9" r="1.4"/></g>`,
|
|
1150
|
+
shape('M9 17.6h5', 'none'),
|
|
1151
|
+
];
|
|
1152
|
+
return { name: 'Bolt', parts, icon };
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
//
|
|
1156
|
+
// 11: Gloop, an alien.
|
|
1157
|
+
//
|
|
1158
|
+
|
|
1159
|
+
function gloop() {
|
|
1160
|
+
const teal = '#14bfae';
|
|
1161
|
+
const deep = '#0b7f86';
|
|
1162
|
+
const berry = '#ff4fa3';
|
|
1163
|
+
// A drop: wide and round below, narrowing to a small rounded crown.
|
|
1164
|
+
const profile = [
|
|
1165
|
+
[0, -0.27],
|
|
1166
|
+
[0.17, -0.24],
|
|
1167
|
+
[0.29, -0.14],
|
|
1168
|
+
[0.33, 0],
|
|
1169
|
+
[0.29, 0.13],
|
|
1170
|
+
[0.2, 0.25],
|
|
1171
|
+
[0.11, 0.335],
|
|
1172
|
+
[0, 0.37],
|
|
1173
|
+
];
|
|
1174
|
+
const at = onLathe(profile);
|
|
1175
|
+
const parts = limbs({ shoe: berry });
|
|
1176
|
+
parts.push(
|
|
1177
|
+
torso(BODY, deep),
|
|
1178
|
+
mat(
|
|
1179
|
+
{ id: 'head', parent: 'torso', kind: 'lathe', position: [0, 0.66, 0], profile, segments: 10 },
|
|
1180
|
+
teal,
|
|
1181
|
+
),
|
|
1182
|
+
// Three eyes: one over two.
|
|
1183
|
+
patch('eyeTop', at(0, 0.14, 0), { r: 0.07, tall: 1.1, segments: 8, mirror: false }, INK),
|
|
1184
|
+
patch('glintTop', at(0.022, 0.172, 0.022), { r: 0.036, segments: 4, mirror: false }, WHITE),
|
|
1185
|
+
patch('eye', at(0.14, -0.005, 0), { r: 0.066, tall: 1.1, segments: 8 }, INK),
|
|
1186
|
+
patch('glint', at(0.16, 0.025, 0.032), { r: 0.036, segments: 4 }, WHITE),
|
|
1187
|
+
smile(at(0, -0.13, 0.004)),
|
|
1188
|
+
// The stalk grows from the back of the crown and leans back.
|
|
1189
|
+
on('head', 'stalk', 'cylinder', deep, {
|
|
1190
|
+
radius: 0.02,
|
|
1191
|
+
height: 0.2,
|
|
1192
|
+
position: [0, 0.36, -0.2],
|
|
1193
|
+
rotation: [-32, 0, 0],
|
|
1194
|
+
segments: 4,
|
|
1195
|
+
}),
|
|
1196
|
+
ball('head', 'bobble', berry, 0.055, [0, 0.45, -0.255]),
|
|
1197
|
+
patch('spotA', at(0.12, 0.1, -0.004, true), { r: 0.07, segments: 4, mirror: false }, deep),
|
|
1198
|
+
patch('spotB', at(-0.11, -0.05, -0.004, true), { r: 0.05, segments: 4, mirror: false }, deep),
|
|
1199
|
+
patch('spotC', at(-0.05, 0.2, -0.004, true), { r: 0.04, segments: 4, mirror: false }, deep),
|
|
1200
|
+
);
|
|
1201
|
+
const icon = [
|
|
1202
|
+
shape('M13 6l3-3.4', 'none'),
|
|
1203
|
+
disc(16.6, 2.4, 1.6, berry),
|
|
1204
|
+
shape('M12 4.5c5 1.6 8 6.5 8 10.5a8 7 0 0 1-16 0c0-4 3-8.9 8-10.5z', teal),
|
|
1205
|
+
disc(12, 11, 1.8, INK, BARE),
|
|
1206
|
+
dots(15.6, 3.6),
|
|
1207
|
+
];
|
|
1208
|
+
return { name: 'Gloop', parts, icon };
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
//
|
|
1212
|
+
// 12: Cap, a mushroom.
|
|
1213
|
+
//
|
|
1214
|
+
|
|
1215
|
+
function cap() {
|
|
1216
|
+
const plum = '#a8479a';
|
|
1217
|
+
const cream = '#fff3d6';
|
|
1218
|
+
const stemColor = '#ffdfa6';
|
|
1219
|
+
const moss = '#7d9a3c';
|
|
1220
|
+
// The stem is the face: an egg standing tall under the cap, so the cap's
|
|
1221
|
+
// rim clears the eyes from a camera that looks down on it.
|
|
1222
|
+
const stem = { radius: 0.25, scale: [1, 1.14, 1] };
|
|
1223
|
+
const at = (x, y, lift) => onHead(stem, x, y, lift);
|
|
1224
|
+
const dome = [
|
|
1225
|
+
[0.18, 0.21],
|
|
1226
|
+
[0.32, 0.19],
|
|
1227
|
+
[0.36, 0.25],
|
|
1228
|
+
[0.325, 0.35],
|
|
1229
|
+
[0.24, 0.43],
|
|
1230
|
+
[0.12, 0.48],
|
|
1231
|
+
[0, 0.495],
|
|
1232
|
+
];
|
|
1233
|
+
const onDome = onLathe(dome);
|
|
1234
|
+
// A few spots of different sizes, none of them placed like another.
|
|
1235
|
+
const spot = (id, x, y, r, back = false) =>
|
|
1236
|
+
patch(id, onDome(x, y, -0.004, back), { r, segments: 5, mirror: false }, cream);
|
|
1237
|
+
const parts = limbs({ shoe: '#7a4a2a', mitt: stemColor });
|
|
1238
|
+
parts.push(
|
|
1239
|
+
torso(BODY, moss),
|
|
1240
|
+
roundHead(stem, 0.6, stemColor, 8),
|
|
1241
|
+
mat({ id: 'cap', parent: 'head', kind: 'lathe', profile: dome, segments: 10 }, plum),
|
|
1242
|
+
spot('spotA', -0.09, 0.355, 0.085),
|
|
1243
|
+
spot('spotB', 0.19, 0.31, 0.048),
|
|
1244
|
+
spot('spotC', 0.05, 0.34, 0.09, true),
|
|
1245
|
+
spot('spotD', -0.21, 0.3, 0.05, true),
|
|
1246
|
+
...eyes(at, { x: 0.1, y: -0.035, r: 0.072, tall: 1.15 }),
|
|
1247
|
+
smile(at(0, -0.15, 0.004), 0.045),
|
|
1248
|
+
cheeks(at(0.18, -0.115, 0), '#ff8f6b', 0.042),
|
|
1249
|
+
);
|
|
1250
|
+
const icon = [
|
|
1251
|
+
oval(12, 16.5, 5.4, 6, stemColor),
|
|
1252
|
+
shape('M2.6 10.6a9.4 8.4 0 0 1 18.8 0q-9.4 2.6-18.8 0z', plum),
|
|
1253
|
+
`<g fill="${cream}" stroke="none"><circle cx="9.4" cy="6.2" r="2.3"/><circle cx="15.6" cy="7.6" r="1.2"/><circle cx="5.4" cy="9.4" r=".9"/></g>`,
|
|
1254
|
+
dots(16, 2.2, 1.3),
|
|
1255
|
+
shape('M10.4 19.2q1.6 1.3 3.2 0', 'none', ' stroke-width="1"'),
|
|
1256
|
+
];
|
|
1257
|
+
return { name: 'Cap', parts, icon };
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
//
|
|
1261
|
+
// 13: Toast, a slice of toast.
|
|
1262
|
+
//
|
|
1263
|
+
|
|
1264
|
+
function toast() {
|
|
1265
|
+
const crust = '#a8612a';
|
|
1266
|
+
const crumb = '#fff2c4';
|
|
1267
|
+
const jam = '#b5305e';
|
|
1268
|
+
const slice = [
|
|
1269
|
+
[-0.2, -0.28],
|
|
1270
|
+
[0.2, -0.28],
|
|
1271
|
+
[0.26, -0.22],
|
|
1272
|
+
[0.25, 0.08],
|
|
1273
|
+
[0.3, 0.17],
|
|
1274
|
+
[0.28, 0.26],
|
|
1275
|
+
[0.17, 0.31],
|
|
1276
|
+
[-0.17, 0.31],
|
|
1277
|
+
[-0.28, 0.26],
|
|
1278
|
+
[-0.3, 0.17],
|
|
1279
|
+
[-0.25, 0.08],
|
|
1280
|
+
[-0.26, -0.22],
|
|
1281
|
+
];
|
|
1282
|
+
const depth = 0.14;
|
|
1283
|
+
const bevel = 0.03;
|
|
1284
|
+
const face = depth / 2 + bevel + 0.012;
|
|
1285
|
+
const at = (x, y, lift) => ({
|
|
1286
|
+
position: [round(x), round(y), round(face + lift)],
|
|
1287
|
+
rotation: [0, 0, 0],
|
|
1288
|
+
});
|
|
1289
|
+
const parts = limbs({ shoe: crust });
|
|
1290
|
+
parts.push(
|
|
1291
|
+
torso(BODY, jam),
|
|
1292
|
+
mat(
|
|
1293
|
+
{
|
|
1294
|
+
id: 'head',
|
|
1295
|
+
parent: 'torso',
|
|
1296
|
+
kind: 'extrude',
|
|
1297
|
+
outline: slice,
|
|
1298
|
+
depth,
|
|
1299
|
+
bevel,
|
|
1300
|
+
flat: false,
|
|
1301
|
+
position: [0, 0.7, 0],
|
|
1302
|
+
},
|
|
1303
|
+
crust,
|
|
1304
|
+
),
|
|
1305
|
+
// The crumb stands a little proud of the crust on both faces.
|
|
1306
|
+
on('head', 'crumb', 'extrude', crumb, {
|
|
1307
|
+
outline: slice.map(([x, y]) => [round(x * 0.86), round(y * 0.86)]),
|
|
1308
|
+
depth: face * 2,
|
|
1309
|
+
flat: false,
|
|
1310
|
+
}),
|
|
1311
|
+
...eyes(at, { x: 0.1, y: -0.02, r: 0.07, tall: 1.15 }),
|
|
1312
|
+
smile(at(0, -0.12, 0.004)),
|
|
1313
|
+
cheeks(at(0.17, -0.1, 0), '#ff8f6b'),
|
|
1314
|
+
on('head', 'butter', 'box', '#fff27a', {
|
|
1315
|
+
size: [0.14, 0.13, 0.04],
|
|
1316
|
+
position: [0.1, 0.16, face + 0.012],
|
|
1317
|
+
rotation: [0, 0, 12],
|
|
1318
|
+
}),
|
|
1319
|
+
);
|
|
1320
|
+
const icon = [
|
|
1321
|
+
shape('M5 22V11.5Q2 9.5 4 6t8-3t8 3t-1 5.5V22z', crust),
|
|
1322
|
+
shape('M7.2 19.8V10.6Q5 9 6.6 7t5.4-1.8T17.4 7t-.6 3.6v9.2z', crumb, BARE),
|
|
1323
|
+
`<rect x="12.6" y="7.3" width="4" height="3.3" rx=".6" fill="#ffe24a" stroke-width=".8"/>`,
|
|
1324
|
+
dots(14.4, 2.3, 1.3),
|
|
1325
|
+
];
|
|
1326
|
+
return { name: 'Toast', parts, icon };
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
//
|
|
1330
|
+
// 14: Scoop, an ice cream.
|
|
1331
|
+
//
|
|
1332
|
+
|
|
1333
|
+
function scoop() {
|
|
1334
|
+
const berry = '#ff93a6';
|
|
1335
|
+
const fudge = '#6a3a1f';
|
|
1336
|
+
const waffle = '#e3a550';
|
|
1337
|
+
const head = { radius: 0.3, scale: [1, 0.97, 1] };
|
|
1338
|
+
const at = (x, y, lift) => onHead(head, x, y, lift);
|
|
1339
|
+
// The sauce: a cap over the top of the scoop, with a rounded drip every quarter
|
|
1340
|
+
// of the way round its edge, the same on both sides.
|
|
1341
|
+
const sauceR = 0.322;
|
|
1342
|
+
const sauceEdge = 34;
|
|
1343
|
+
const sauce = [sauceEdge, 58].map((e) => [
|
|
1344
|
+
round(sauceR * Math.cos(rad(e))),
|
|
1345
|
+
round(sauceR * 0.97 * Math.sin(rad(e))),
|
|
1346
|
+
]);
|
|
1347
|
+
sauce.push([0, round(sauceR * 0.97)]);
|
|
1348
|
+
const edgeR = 0.3 * Math.cos(rad(sauceEdge));
|
|
1349
|
+
const edgeY = 0.3 * 0.97 * Math.sin(rad(sauceEdge));
|
|
1350
|
+
const drip = (turn, long) =>
|
|
1351
|
+
ball(
|
|
1352
|
+
'head',
|
|
1353
|
+
`drip${turn}`,
|
|
1354
|
+
fudge,
|
|
1355
|
+
0.095,
|
|
1356
|
+
[edgeR * Math.sin(rad(turn)), edgeY + 0.04 - long * 0.045, edgeR * Math.cos(rad(turn))],
|
|
1357
|
+
{ scale: [0.95, long, 0.5], rotation: [30, turn, 0] },
|
|
1358
|
+
);
|
|
1359
|
+
const onSauce = onLathe(sauce);
|
|
1360
|
+
// A sprinkle lying on the sauce, `turn` degrees round and `tilt` in its plane.
|
|
1361
|
+
const sprinkle = (id, color, x, y, tilt) => {
|
|
1362
|
+
const lie = onSauce(x, y, 0.012);
|
|
1363
|
+
return on('head', id, 'box', color, {
|
|
1364
|
+
size: [0.085, 0.03, 0.03],
|
|
1365
|
+
position: lie.position,
|
|
1366
|
+
rotation: [lie.rotation[0], lie.rotation[1], tilt],
|
|
1367
|
+
});
|
|
1368
|
+
};
|
|
1369
|
+
const parts = limbs({ shoe: fudge });
|
|
1370
|
+
parts.push(
|
|
1371
|
+
// The body is the cone.
|
|
1372
|
+
torso(
|
|
1373
|
+
[
|
|
1374
|
+
[0, -0.08],
|
|
1375
|
+
[0.11, -0.06],
|
|
1376
|
+
[0.215, 0.36],
|
|
1377
|
+
[0.225, 0.41],
|
|
1378
|
+
[0, 0.41],
|
|
1379
|
+
],
|
|
1380
|
+
waffle,
|
|
1381
|
+
),
|
|
1382
|
+
roundHead(head, 0.71, berry, 9),
|
|
1383
|
+
// The scoop's foot, pressed out over the cone's rim.
|
|
1384
|
+
on('head', 'foot', 'cylinder', berry, {
|
|
1385
|
+
radius: 0.27,
|
|
1386
|
+
radiusTop: 0.24,
|
|
1387
|
+
height: 0.07,
|
|
1388
|
+
position: [0, -0.265, 0],
|
|
1389
|
+
segments: 8,
|
|
1390
|
+
}),
|
|
1391
|
+
mat({ id: 'sauce', parent: 'head', kind: 'lathe', profile: sauce, segments: 10 }, fudge),
|
|
1392
|
+
drip(45, 1.25),
|
|
1393
|
+
drip(135, 1.05),
|
|
1394
|
+
drip(225, 1.05),
|
|
1395
|
+
drip(315, 1.25),
|
|
1396
|
+
sprinkle('sprinkleA', '#fff27a', -0.09, 0.262, 35),
|
|
1397
|
+
sprinkle('sprinkleB', '#7ae0ff', 0.1, 0.25, -50),
|
|
1398
|
+
...eyes(at, { x: 0.11, y: -0.03, r: 0.07, tall: 1.15 }),
|
|
1399
|
+
smile(at(0, -0.135, 0.004)),
|
|
1400
|
+
);
|
|
1401
|
+
const icon = [
|
|
1402
|
+
shape('M7 15.5h10l-5 7.5z', waffle),
|
|
1403
|
+
disc(12, 10.5, 7.5, berry),
|
|
1404
|
+
shape(
|
|
1405
|
+
'M4.6 9.4a7.5 7.5 0 0 1 14.8 0q-.2 1.5-1.3 1.5t-1.2-1.4q-.1 2.6-1.3 2.6t-1.2-2.6q-.1 1.4-1.2 1.4t-1.2-1.4q-.1 2.6-1.3 2.6T8.3 9.5q-.1 1.4-1.2 1.4T4.6 9.4z',
|
|
1406
|
+
fudge,
|
|
1407
|
+
),
|
|
1408
|
+
shape('M9 6.3l2.2-1.2', 'none', ' stroke="#fff27a" stroke-width="1.2"'),
|
|
1409
|
+
shape('M13.2 5.2l1.6 1.8', 'none', ' stroke="#7ae0ff" stroke-width="1.2"'),
|
|
1410
|
+
dots(13.6, 2.4, 1.2),
|
|
1411
|
+
];
|
|
1412
|
+
return { name: 'Scoop', parts, icon };
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
//
|
|
1416
|
+
// 15: Zest, an orange.
|
|
1417
|
+
//
|
|
1418
|
+
|
|
1419
|
+
function zest() {
|
|
1420
|
+
const orange = '#ff8a14';
|
|
1421
|
+
const leaf = '#4fc04a';
|
|
1422
|
+
const head = { radius: 0.31, scale: [1.06, 0.94, 1.04] };
|
|
1423
|
+
const at = (x, y, lift) => onHead(head, x, y, lift);
|
|
1424
|
+
const parts = limbs({ shoe: orange });
|
|
1425
|
+
parts.push(
|
|
1426
|
+
torso(BODY, '#2f9e55'),
|
|
1427
|
+
roundHead(head, 0.68, orange, 12),
|
|
1428
|
+
...eyes(at, { x: 0.12, y: 0.03, r: 0.075, tall: 1.15 }),
|
|
1429
|
+
smile(at(0, -0.085, 0.004), 0.06, 0.017),
|
|
1430
|
+
cheeks(at(0.215, -0.07, 0), '#ff5a3c'),
|
|
1431
|
+
// A short stem at the back of the crown, and a leaf lying off to one side.
|
|
1432
|
+
on('head', 'stem', 'cylinder', '#6b3d20', {
|
|
1433
|
+
radius: 0.03,
|
|
1434
|
+
height: 0.09,
|
|
1435
|
+
position: [0, 0.3, -0.07],
|
|
1436
|
+
segments: 5,
|
|
1437
|
+
}),
|
|
1438
|
+
on('head', 'leaf', 'extrude', leaf, {
|
|
1439
|
+
outline: [
|
|
1440
|
+
[0, 0],
|
|
1441
|
+
[0.09, 0.1],
|
|
1442
|
+
[0.06, 0.21],
|
|
1443
|
+
[0, 0.27],
|
|
1444
|
+
[-0.06, 0.21],
|
|
1445
|
+
[-0.09, 0.1],
|
|
1446
|
+
],
|
|
1447
|
+
depth: 0.035,
|
|
1448
|
+
flat: false,
|
|
1449
|
+
position: [0.02, 0.265, -0.08],
|
|
1450
|
+
rotation: [-65, 0, -75],
|
|
1451
|
+
}),
|
|
1452
|
+
);
|
|
1453
|
+
const icon = [
|
|
1454
|
+
disc(12, 14, 8.5, orange),
|
|
1455
|
+
shape('M12 5.8q3.5-6 8.5-3.2q-3 5.4-8.5 3.2z', leaf),
|
|
1456
|
+
dots(13.2),
|
|
1457
|
+
shape('M9.2 16.4q2.8 2.4 5.6 0', 'none'),
|
|
1458
|
+
];
|
|
1459
|
+
return { name: 'Zest', parts, icon };
|
|
576
1460
|
}
|
|
577
1461
|
|
|
578
1462
|
//
|
|
@@ -617,5 +1501,38 @@ function write(index, { name, look = LOOK, parts }) {
|
|
|
617
1501
|
fs.writeFileSync(path.join(OUT_DIR, `avatar-${index}.pxmodel`), lines.join('\n'));
|
|
618
1502
|
}
|
|
619
1503
|
|
|
1504
|
+
// `code/client/avatarFaces.js`: per avatar index, its name and its face.
|
|
1505
|
+
function writeFaces(characters) {
|
|
1506
|
+
const lines = [
|
|
1507
|
+
'// Generated by scripts/gen-avatars.mjs; do not edit. Each avatar index: the',
|
|
1508
|
+
"// character's name, and its face for the picker (`chrome.js`), the inside of a",
|
|
1509
|
+
'// 24 x 24 SVG.',
|
|
1510
|
+
'export const AVATAR_FACES = [',
|
|
1511
|
+
...characters.map(({ name, icon }) => ` ['${name}', '${icon.join('')}'],`),
|
|
1512
|
+
'];',
|
|
1513
|
+
'',
|
|
1514
|
+
];
|
|
1515
|
+
fs.writeFileSync(FACES_FILE, lines.join('\n'));
|
|
1516
|
+
}
|
|
1517
|
+
|
|
620
1518
|
fs.mkdirSync(OUT_DIR, { recursive: true });
|
|
621
|
-
|
|
1519
|
+
const characters = [
|
|
1520
|
+
mascot,
|
|
1521
|
+
petal,
|
|
1522
|
+
beat,
|
|
1523
|
+
star,
|
|
1524
|
+
biscuit,
|
|
1525
|
+
mochi,
|
|
1526
|
+
hop,
|
|
1527
|
+
pip,
|
|
1528
|
+
ribbit,
|
|
1529
|
+
ember,
|
|
1530
|
+
bolt,
|
|
1531
|
+
gloop,
|
|
1532
|
+
cap,
|
|
1533
|
+
toast,
|
|
1534
|
+
scoop,
|
|
1535
|
+
zest,
|
|
1536
|
+
].map((make) => make());
|
|
1537
|
+
characters.forEach((character, index) => write(index, character));
|
|
1538
|
+
writeFaces(characters);
|