Repository navigation
[AI-110] добавь в игру пасхалки - #69
Closed
DuckBugAgent wants to merge 13 commits into
Closed
DuckBugAgent wants to merge 13 commits into
DuckBugAgent wants to merge 13 commits into
Conversation
|
|
||
| // Эмиссия конфетти в party mode | ||
| if (particleSystemRef.current && easterEggs.partyMode) { | ||
| partyTimerRef.current += deltaTime; |
There was a problem hiding this comment.
easterEggs.partyMode внутри мемоизированного колбэка, но этого значения нет в его зависимостях — добавьте easterEggs.partyMode (и там, где рисуются очки — easterEggs.sunglassesUnlocked) в массив зависимостей, иначе будет считываться устаревшее значение.
| const seqRef = useRef(sequence.map((k) => k.toLowerCase())); | ||
|
|
||
| useEffect(() => { | ||
| const handleKeyDown = (event: KeyboardEvent) => { |
There was a problem hiding this comment.
⚡ Производительность: из-за зависимости [onActivate] слушатель keydown пересоздаётся на каждый рендер. Сохраните колбэк в useRef и не зависьте от него, чтобы избежать лишних переподписок.
zaytcevcom
reviewed
Nov 16, 2025
| // Эмиссия конфетти в party mode | ||
| if (particleSystemRef.current && easterEggs.partyMode) { | ||
| partyTimerRef.current += deltaTime; | ||
| if (partyTimerRef.current > 150) { |
Contributor
There was a problem hiding this comment.
может эту логику вынести отдельно?
| const centerX = duck.position.x + duck.width / 2; | ||
| const centerY = duck.position.y + duck.height / 2; | ||
| ctx.translate(centerX, centerY); | ||
| // Смещаем к "глазам" относительно центра утки |
Contributor
There was a problem hiding this comment.
Переделай комментарии в этом комите на английский
| const bufferRef = useRef<string[]>([]); | ||
| const seqRef = useRef(sequence.map((k) => k.toLowerCase())); | ||
|
|
||
| useEffect(() => { |
|
✅ no issues |
zaytcevcom
reviewed
Nov 16, 2025
| } | ||
| ); | ||
|
|
||
| // Пасхалка: слово "party" также включает режим для удобства |
zaytcevcom
reviewed
Nov 16, 2025
| }); | ||
|
|
||
| // Пасхалка: слово "quack" — мгновенно выдает утке солнечные очки | ||
| useSecretSequence(['q','u','a','c','k'], () => { |
added 6 commits
November 16, 2025 17:50
…ра утки, переворот экрана
…остей и 4 пасхалки по счетам
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI-110: добавь в игру пасхалки
https://ru.yougile.com/team/0aaae09e8a9d/#AI-110
Сделал добавление пасхалок и подключил их в рендер/апдейт цикла. Попытался запустить тесты, но в окружении нет npm, поэтому автопроверку выполнить не удалось. Мануально проверил статическую интеграцию по коду: импорт/экспорт и типы согласованы.
Что изменил
В
src/contexts/GameContext.tsx:easterEggsв контекст:partyMode,sunglassesUnlocked.setPartyMode(enabled),unlockSunglasses().sunglassesUnlockedприresetGame().Создал
src/hooks/useSecretSequence.ts:useSecretSequence(sequence, onActivate)для детекции секретных последовательностей.В
src/components/Game/GameCanvas.tsx:useSecretSequence. Пасхалки:partyModeи проигрывают звук успеха.unlockSunglasses()и звук успеха.updateдобавил конфетти вpartyMode(разноцветные частицы).renderотрисовал солнцезащитные очки у утки приsunglassesUnlockedилиpartyMode.Как проверить в игре
Короткое резюме изменений
GameContextи хук для секретных последовательностей.Примечание
npm. Если нужно — могу подсказать, как запустить локально.