From e75121cb3ddb8cf409755a20b9dbbbda2a583739 Mon Sep 17 00:00:00 2001
From: min
Date: Tue, 9 Jun 2026 22:49:14 +0300
Subject: [PATCH] =?UTF-8?q?docs(40)=20+=20feat(g41):=20=C2=AB=D0=9F=D0=BB?=
=?UTF-8?q?=D0=B0=D1=82=D1=84=D0=BE=D1=80=D0=BC=D0=B5=D1=80-=D0=BF=D1=80?=
=?UTF-8?q?=D0=B8=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=C2=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
g40 docs: CodeBoth g40_main.
g41 паритет:
- Heartbeat py<-3 → LoadCharacter + lose
- BindableEvents CoinCollected/CheckpointReached/TreasureFound
- 5 g41_coin_N (id 10..14): Touched → CoinCollected:Fire + Destroy
- g41_cp: Touched → CheckpointReached:Fire → setSpawn(-0.5,7,28)
- g41_finish: Touched → TreasureFound:Fire → 'Победа! Сокровище и N монет!' + confetti
---
src/community/docsGamesBuildersLua.js | 116 +++++++++++++++++++++++++-
src/community/docsLessons.jsx | 4 +-
2 files changed, 117 insertions(+), 3 deletions(-)
diff --git a/src/community/docsGamesBuildersLua.js b/src/community/docsGamesBuildersLua.js
index 5c717cd..0dab273 100644
--- a/src/community/docsGamesBuildersLua.js
+++ b/src/community/docsGamesBuildersLua.js
@@ -3685,7 +3685,121 @@ task.delay(2, startWave)`,
},
// ═══════════════════════════════════════════════════════════════
- // ИГРЫ 41-50: явных Lua-версий пока нет.
+ // ИГРА 41 — «Платформер-приключение»
+ // ═══════════════════════════════════════════════════════════════
+ 'adventure-platformer': (function() {
+ // Монетки — id 10..14 (после 9 платформ)
+ const COIN_IDS = [10, 11, 12, 13, 14];
+ const overrides = {
+ g41_main: `-- === ИГРА «ПЛАТФОРМЕР-ПРИКЛЮЧЕНИЕ» — главный скрипт (Lua) ===
+${SNIPPET_BROADCAST}
+
+local Players = game:GetService("Players")
+local RunService = game:GetService("RunService")
+local player = Players.LocalPlayer
+local coins = 0
+local won = false
+
+__rbxl_score_set(0)
+__rbxl_show_text("Доберись до сокровища! Собирай монетки", 4)
+
+local coinSound = Instance.new("Sound", workspace)
+coinSound.SoundId = "coin"; coinSound.Volume = 0.7
+local pickupSound = Instance.new("Sound", workspace)
+pickupSound.SoundId = "pickup"; pickupSound.Volume = 0.7
+local loseSound = Instance.new("Sound", workspace)
+loseSound.SoundId = "lose"; loseSound.Volume = 0.7
+local winSound = Instance.new("Sound", workspace)
+winSound.SoundId = "win"; winSound.Volume = 1
+
+-- Респаун при падении
+RunService.Heartbeat:Connect(function()
+ if won then return end
+ local py = __rbxl_player_y()
+ if py < -3 then
+ player:LoadCharacter()
+ loseSound:Play()
+ end
+end)
+
+-- Монетка
+local coinEvent = getEvent("CoinCollected")
+coinEvent.Event:Connect(function()
+ coins = coins + 1
+ __rbxl_score_set(coins)
+ coinSound:Play()
+end)
+
+-- Чекпоинт
+local cpEvent = getEvent("CheckpointReached")
+cpEvent.Event:Connect(function()
+ __rbxl_set_spawn(-0.5, 7, 28)
+ __rbxl_show_text("Чекпоинт! Дальше — отсюда.", 2)
+ pickupSound:Play()
+end)
+
+-- Сокровище = победа
+local treasureEvent = getEvent("TreasureFound")
+treasureEvent.Event:Connect(function()
+ if won then return end
+ won = true
+ __rbxl_show_text("Победа! Сокровище и " .. coins .. " монет!", 6)
+ winSound:Play()
+ local px = __rbxl_player_x()
+ local py = __rbxl_player_y()
+ local pz = __rbxl_player_z()
+ __rbxl_spawn_particles("confetti", px, py + 3, pz, 3, 3)
+end)`,
+ g41_cp: `-- === Скрипт чекпоинта (Lua) ===
+local ReplicatedStorage = game:GetService("ReplicatedStorage")
+local part = script.Parent
+local fired = false
+
+part.Touched:Connect(function(hit)
+ if fired then return end
+ local h = hit.Parent and hit.Parent:FindFirstChild("Humanoid")
+ if not h then return end
+ fired = true
+ local ev = ReplicatedStorage:FindFirstChild("CheckpointReached")
+ if ev then ev:Fire() end
+end)`,
+ g41_finish: `-- === Скрипт сокровища (Lua) ===
+local ReplicatedStorage = game:GetService("ReplicatedStorage")
+local part = script.Parent
+local fired = false
+
+part.Touched:Connect(function(hit)
+ if fired then return end
+ local h = hit.Parent and hit.Parent:FindFirstChild("Humanoid")
+ if not h then return end
+ fired = true
+ local ev = ReplicatedStorage:FindFirstChild("TreasureFound")
+ if ev then ev:Fire() end
+end)`,
+ };
+ // 5 монеток: Touched → CoinCollected:Fire + Destroy
+ const coinScript = `-- === Скрипт монетки (Lua) ===
+local ReplicatedStorage = game:GetService("ReplicatedStorage")
+local part = script.Parent
+local taken = false
+
+part.Touched:Connect(function(hit)
+ if taken then return end
+ local h = hit.Parent and hit.Parent:FindFirstChild("Humanoid")
+ if not h then return end
+ taken = true
+ local ev = ReplicatedStorage:FindFirstChild("CoinCollected")
+ if ev then ev:Fire() end
+ part:Destroy()
+end)`;
+ for (const cid of COIN_IDS) {
+ overrides['g41_coin_' + cid] = coinScript;
+ }
+ return overrides;
+ })(),
+
+ // ═══════════════════════════════════════════════════════════════
+ // ИГРЫ 42-50: явных Lua-версий пока нет.
// buildGameProject в docsGamesBuilders.js использует generateFallbackLua
// (главный скрипт → показ подсказки + слушает FinishReached →
// победа+конфетти; скрипт на финиш-примитиве → шлёт FinishReached;
diff --git a/src/community/docsLessons.jsx b/src/community/docsLessons.jsx
index 8ce5884..87bd020 100644
--- a/src/community/docsLessons.jsx
+++ b/src/community/docsLessons.jsx
@@ -5691,7 +5691,7 @@ game.self.onInteract(() => {
и считает врагов.
- {`// === ИГРА «ВЫЖИВАНИЕ ОТ ВОЛН» — главный скрипт ===
+ {`// === ИГРА «ВЫЖИВАНИЕ ОТ ВОЛН» — главный скрипт ===
const WAVES = 3; // всего волн
let wave = 0;
@@ -5748,7 +5748,7 @@ function startWave() {
}
}
-game.after(2, startWave); // первая волна через 2 секунды`}
+game.after(2, startWave); // первая волна через 2 секунды`}
Разберём:
startWave() — функция одной волны. Она