From b42685521c962008287b6b7627cc2f7c859dc628 Mon Sep 17 00:00:00 2001
From: min
Date: Tue, 9 Jun 2026 22:41:55 +0300
Subject: [PATCH] =?UTF-8?q?docs(38)=20+=20feat(g39):=20=C2=AB=D0=91=D0=B0?=
=?UTF-8?q?=D1=88=D0=BD=D1=8F=20=E2=80=94=20=D1=81=D1=82=D1=80=D0=BE=D0=B9?=
=?UTF-8?q?=D0=BA=D0=B0=C2=BB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
g38 docs: CodeBoth main+tile_1.
g39 паритет:
- STEPS=8, placed counter
- BindableEvent BlockPlaced(n)
- 8 g39_spot_N: Heartbeat distance(4) → '[E] Поставить блок'
E → CanCollide=true, Transparency=0, Color коричневый,
BlockPlaced:Fire(n)
- Главный: n=placed+1? placed++; иначе 'Сначала поставь ниже!'
- 8 → 'Победа!' + confetti
---
src/community/docsGamesBuildersLua.js | 91 ++++++++++++++++++++++++++-
src/community/docsLessons.jsx | 8 +--
2 files changed, 94 insertions(+), 5 deletions(-)
diff --git a/src/community/docsGamesBuildersLua.js b/src/community/docsGamesBuildersLua.js
index 916d94f..f00f2a3 100644
--- a/src/community/docsGamesBuildersLua.js
+++ b/src/community/docsGamesBuildersLua.js
@@ -3511,7 +3511,96 @@ end)`;
})(),
// ═══════════════════════════════════════════════════════════════
- // ИГРЫ 39-50: явных Lua-версий пока нет.
+ // ИГРА 39 — «Башня — стройка»
+ // ═══════════════════════════════════════════════════════════════
+ 'tower-build': (function() {
+ const STEPS = 8;
+ const overrides = {
+ g39_main: `-- === ИГРА «БАШНЯ — СТРОЙКА» — главный скрипт (Lua) ===
+${SNIPPET_BROADCAST}
+
+local STEPS = ${STEPS}
+local placed = 0
+
+__rbxl_score_set(0)
+__rbxl_show_text("Подходи к местам и ставь блоки (E) снизу вверх", 4)
+
+local clickSound = Instance.new("Sound", workspace)
+clickSound.SoundId = "click"; clickSound.Volume = 0.6
+local winSound = Instance.new("Sound", workspace)
+winSound.SoundId = "win"; winSound.Volume = 1
+
+-- Места шлют BlockPlaced:Fire(n)
+local ev = getEvent("BlockPlaced")
+ev.Event:Connect(function(n)
+ if n ~= placed + 1 then
+ __rbxl_show_text("Сначала поставь блок ниже!", 1.5)
+ return
+ end
+ placed = placed + 1
+ __rbxl_score_set(placed)
+ clickSound:Play()
+ if placed >= STEPS then
+ __rbxl_show_text("Победа! Башня построена!", 5)
+ 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)
+ else
+ __rbxl_show_text("Блок " .. placed .. " из " .. STEPS, 1.5)
+ end
+end)`,
+ };
+ // 8 мест-призраков — E делает блок «реальным»
+ for (let i = 1; i <= STEPS; i++) {
+ overrides['g39_spot_' + i] = `-- === Скрипт места под блок ${i} (Lua) ===
+local UserInputService = game:GetService("UserInputService")
+local ReplicatedStorage = game:GetService("ReplicatedStorage")
+local RunService = game:GetService("RunService")
+local part = script.Parent
+
+local built = false
+local hintVisible = false
+
+RunService.Heartbeat:Connect(function()
+ if built then return end
+ local px = __rbxl_player_x()
+ local pz = __rbxl_player_z()
+ local dx = part.Position.X - px
+ local dz = part.Position.Z - pz
+ local dist = math.sqrt(dx*dx + dz*dz)
+ local near = dist <= 4
+ if near ~= hintVisible then
+ hintVisible = near
+ if near then
+ __rbxl_hud_set("g39_spot_${i}_hint", "[E] Поставить блок", 50, 75, "#ffe44a", 20)
+ else
+ __rbxl_hud_set("g39_spot_${i}_hint", nil)
+ end
+ end
+end)
+
+UserInputService.InputBegan:Connect(function(input, gp)
+ if gp then return end
+ if not hintVisible then return end
+ if built then return end
+ if input.KeyCode ~= Enum.KeyCode.E then return end
+ built = true
+ -- Делаем блок «реальным»: твёрдым, непрозрачным, коричневым
+ part.CanCollide = true
+ part.Transparency = 0
+ part.Color = Color3.fromRGB(181, 101, 29)
+ __rbxl_hud_set("g39_spot_${i}_hint", nil)
+ local ev = ReplicatedStorage:FindFirstChild("BlockPlaced")
+ if ev then ev:Fire(${i}) end
+end)`;
+ }
+ return overrides;
+ })(),
+
+ // ═══════════════════════════════════════════════════════════════
+ // ИГРЫ 40-50: явных Lua-версий пока нет.
// buildGameProject в docsGamesBuilders.js использует generateFallbackLua
// (главный скрипт → показ подсказки + слушает FinishReached →
// победа+конфетти; скрипт на финиш-примитиве → шлёт FinishReached;
diff --git a/src/community/docsLessons.jsx b/src/community/docsLessons.jsx
index e69d927..43c7134 100644
--- a/src/community/docsLessons.jsx
+++ b/src/community/docsLessons.jsx
@@ -5394,7 +5394,7 @@ game.self.onTouch(() => {
верно ли игрок повторяет.
- {`// === ИГРА «МУЗЫКАЛЬНАЯ ИГРА» — главный скрипт ===
+ {`// === ИГРА «МУЗЫКАЛЬНАЯ ИГРА» — главный скрипт ===
const SOUNDS = ['coin', 'jump', 'click', 'hit']; // плитки 1..4
// загаданная последовательность из 5 нот
@@ -5440,7 +5440,7 @@ game.onMessage('press', (d) => {
game.ui.showText('Ошибка! Слушай и пробуй снова.', 2);
game.sound.play('lose');
}
-});`}
+});`}
Разберём: