画面を散らかす効果(肉球の足跡・爪とぎ跡)を追加#8
Merged
Merged
Conversation
The cat now drops paw prints while running and scratch marks while scratching (togi), drawn on a full-screen click-through overlay panel that sits just below the cat. Marks fade over their lifetime and are capped to bound memory. togi fires at screen edges as before, plus a 50% chance on any stop away from a wall. Both effects are off by default and toggled from the menu (Paw Prints / Scratch Marks / Clear Mess), with state persisted in UserDefaults. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pp772scLq2mo9cDaybWrLu
Address two correctness findings from the crit review: - lastPawPos was initialized to .zero, so the very first running frame (the cat starts in .running near the cursor, far from the origin) dropped a paw print immediately, ignoring the spacing rule and using the heading-0 fallback angle. Make it optional and seed it on the first running frame so the first step drops no print. - isClawing's doc still claimed scratch marks stay limited to walls, but togiChance now triggers togi at random stops anywhere. Update the comment to match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Pp772scLq2mo9cDaybWrLu
There was a problem hiding this comment.
Pull request overview
猫が画面上に「肉球の足跡」と「爪とぎ跡」を残す“散らかす”演出を追加し、全画面のクリック透過オーバーレイに CGContext で描画して一定時間でフェードアウトさせることで、デスクトップペットとしての表現を強化するPRです。
Changes:
LitterField/LitterViewを新規追加し、足跡・爪とぎ跡の生成、寿命管理、描画を実装NecoAppに全画面オーバーレイパネルとメニュー項目(ON/OFF、Clear)および UserDefaults 永続化を追加Neko側に「走行中 / 爪とぎ中」状態の公開と、停止後にランダムでtogiへ遷移するロジックを追加
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Neco/Neko.swift | isRunning / isClawing の公開と、停止後に確率で togi へ遷移する挙動を追加 |
| Neco/NecoApp.swift | 足跡/爪とぎ跡用の全画面オーバーレイパネル、メニュー操作、UserDefaults 永続化、画面構成変更追従を追加 |
| Neco/Litter.swift | マーク生成・寿命管理(LitterField)と描画(LitterView)を新規実装 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
概要
猫が画面を散らかす効果を2種類追加しました。どちらもメニューから個別にON/OFFでき、初期状態では両方OFFです。
togi)中に平行な引っかき線を落とす跡は猫の1つ下のレベルに置いた全画面クリックスルーの透明オーバーレイパネルに
CGContextで手描きし、寿命(肉球12秒・爪とぎ20秒)で徐々にフェードして消えます。最大400個で古いものから破棄。実装
Neco/Litter.swift(新規):LitterField(跡の生成・寿命管理)とLitterView(描画)Neco/NecoApp.swift: 全画面オーバーレイパネルの生成、メニュー項目(Paw Prints / Scratch Marks / Clear Mess)、UserDefaults による状態の永続化、画面構成変更への追従Neco/Neko.swift:isRunning/isClawingを公開。chooseAfterStopを「画面端では従来どおりtogi、端でなくてもTuning.togiChance(50%)でランダムにtogi」に変更レビュー
crit で重ね掛けレビュー(司令塔+独立3観点)を実施し、確定した2件を修正済み:
lastPawPosの初期値.zeroにより起動直後に暴発していた最初の足跡を修正(optional化してシード)togiランダム化に伴い実態とズレていたisClawingのコメントを修正パフォーマンス系(全画面再描画の dirtyRect 化ほか)は指摘として記録し、今回は見送り。
確認
xcodebuild)🤖 Generated with Claude Code