From 19c475f1325bdb4be78547bfc0d15b61e254938a Mon Sep 17 00:00:00 2001 From: min Date: Tue, 9 Jun 2026 21:48:31 +0300 Subject: [PATCH] =?UTF-8?q?docs:=20CodeBoth=20=D0=B4=D0=BB=D1=8F=20=D1=83?= =?UTF-8?q?=D1=80=D0=BE=D0=BA=D0=B0=2026=20=C2=AB=D0=9C=D0=B0=D0=B3=D0=BD?= =?UTF-8?q?=D0=B8=D1=82=20=D0=BC=D0=BE=D0=BD=D0=B5=D1=82=C2=BB=20(main+coi?= =?UTF-8?q?n)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/community/docsLessons.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/community/docsLessons.jsx b/src/community/docsLessons.jsx index f0aa22a..9bc10ec 100644 --- a/src/community/docsLessons.jsx +++ b/src/community/docsLessons.jsx @@ -3621,7 +3621,7 @@ game.self.onTouch(() => {

Шаг 2. Главный скрипт

- {`// === ИГРА «МАГНИТ МОНЕТ» — главный скрипт === + {`// === ИГРА «МАГНИТ МОНЕТ» — главный скрипт === let score = 0; const TOTAL = 8; @@ -3641,7 +3641,7 @@ game.onMessage('coin', () => { game.scene.spawnParticles('confetti', { x: p.x, y: p.y + 3, z: p.z }, { duration: 3, count: 3 }); } -});`} +});`}

Главный скрипт простой — он только считает собранные монетки и проверяет победу. Каждая монетка работает @@ -3654,7 +3654,7 @@ game.onMessage('coin', () => {

Шаг 3. Скрипт магнитной монетки

Этот скрипт вешается на каждую монетку.

- {`// === Скрипт магнитной монетки === + {`// === Скрипт магнитной монетки === let flying = false; // монетка уже летит к игроку? let taken = false; @@ -3681,7 +3681,7 @@ game.onTick(() => { { x: p.x, y: p.y + 1, z: p.z }, { duration: 0.5, easing: 'ease' }); } -});`} +});`}

Разберём по частям:

  • первые кадры game.self.position и