Closed aj47 closed 1 year ago
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
frontend/src/store.js
✅ Commit 0708ed6
• Add a new state setUserHarvesting to track when the user is in the process of harvesting. This state should be set to true when the user clicks "Harvest" on the BerryTree and set to false when the user is not harvesting.Sandbox Execution Logs
trunk init
1/3 ✓⡿ Downloading Trunk 1.16.0... ⡿ Downloading Trunk 1.16.0... ⢿ Downloading Trunk 1.16.0... ⣻ Downloading Trunk 1.16.0... ⣽ Downloading Trunk 1.16.0... ⣾ Downloading Trunk 1.16.0... ⣷ Downloading Trunk 1.16.0... ⣯ Downloading Trunk 1.16.0... ⣟ Downloading Trunk 1.16.0... ⡿ Downloading Trunk 1.16.0... ⢿ Downloading Trunk 1.16.0... ⣻ Downloading Trunk 1.16.0... ⣽ Downloading Trunk 1.16.0... ⣾ Downloading Trunk 1.16.0... ✔ Downloading Trunk 1.16.0... done ⡿ Verifying Trunk sha256... ✔ Verifying Trunk sha256... done ⡿ Unpacking Trunk... ✔ Unpacking Trunk... done ✔ 11 linters were enabled (.trunk/trunk.yaml) checkov 2.4.9 (17 json, 4 yaml files) dotenv-linter 3.3.0 (1 dotenv file) git-diff-check (257 files) markdownlint 0.37.0 (3 markdown files) (created .markdownlint.yaml) osv-scanner 1.4.0 (6 lockfile files) oxipng 8.0.0 (36 png files) prettier 3.0.3 (7 css, 2 html, 53 javascript, 8 json, 3 markdown, 22 typescript, 4 yaml files) svgo 3.0.2 (18 svg files) (created svgo.config.js) trivy 0.45.1 (6 lockfile, 4 yaml files) trufflehog 3.57.0 (716 files) yamllint 1.32.0 (4 yaml files) (created .yamllint.yaml) Next Steps 1. Read documentation Our documentation can be found at https://docs.trunk.io 2. Get help and give feedback Join the Trunk community at https://slack.trunk.io
trunk fmt frontend/src/store.js
2/3 ✓✔ Formatted frontend/src/store.js Re-checking autofixed files... Checked 1 file ✔ No issues
trunk check --fix frontend/src/store.js
3/3 ✓Checked 1 file ✔ No issues
frontend/src/Components/3D/PlayerController.tsx
✅ Commit f38fd55
• Import the setUserHarvesting state from store.js. • Add a new useEffect hook that listens for changes to the setUserHarvesting state. Inside this hook, add logic to play the "RightHook" animation when setUserHarvesting is true and the player is within a certain range of the BerryTree. • Add a new function walkTowardsBerryTree that moves the player towards the BerryTree when setUserHarvesting is true. This function should be similar to the existing walkTowardsOtherPlayer function, but it should move the player towards the BerryTree instead of another player. • Modify the existing walkToPointOnLand function to call walkTowardsBerryTree when setUserHarvesting is true.Sandbox Execution Logs
trunk init
1/3 ✓⡿ Downloading Trunk 1.16.0... ⡿ Downloading Trunk 1.16.0... ⢿ Downloading Trunk 1.16.0... ⣻ Downloading Trunk 1.16.0... ⣽ Downloading Trunk 1.16.0... ⣾ Downloading Trunk 1.16.0... ⣷ Downloading Trunk 1.16.0... ⣯ Downloading Trunk 1.16.0... ⣟ Downloading Trunk 1.16.0... ⡿ Downloading Trunk 1.16.0... ⢿ Downloading Trunk 1.16.0... ⣻ Downloading Trunk 1.16.0... ⣽ Downloading Trunk 1.16.0... ⣾ Downloading Trunk 1.16.0... ✔ Downloading Trunk 1.16.0... done ⡿ Verifying Trunk sha256... ✔ Verifying Trunk sha256... done ⡿ Unpacking Trunk... ✔ Unpacking Trunk... done ✔ 11 linters were enabled (.trunk/trunk.yaml) checkov 2.4.9 (17 json, 4 yaml files) dotenv-linter 3.3.0 (1 dotenv file) git-diff-check (257 files) markdownlint 0.37.0 (3 markdown files) (created .markdownlint.yaml) osv-scanner 1.4.0 (6 lockfile files) oxipng 8.0.0 (36 png files) prettier 3.0.3 (7 css, 2 html, 53 javascript, 8 json, 3 markdown, 22 typescript, 4 yaml files) svgo 3.0.2 (18 svg files) (created svgo.config.js) trivy 0.45.1 (6 lockfile, 4 yaml files) trufflehog 3.57.0 (716 files) yamllint 1.32.0 (4 yaml files) (created .yamllint.yaml) Next Steps 1. Read documentation Our documentation can be found at https://docs.trunk.io 2. Get help and give feedback Join the Trunk community at https://slack.trunk.io
trunk fmt frontend/src/Components/3D/PlayerController.tsx
2/3 ✓✔ Formatted frontend/src/Components/3D/PlayerController.tsx Re-checking autofixed files... Checked 1 file ✔ No issues
trunk check --fix frontend/src/Components/3D/PlayerController.tsx
3/3 ✓Checked 1 file ✔ No issues
Here are my self-reviews of my changes at sweep/harvest-animation
.
Here is the 1st review
Hi there, great job on the changes so far! However, there's a small issue that needs to be addressed: In the file `frontend/src/Components/3D/PlayerController.tsx`, you've added a condition to check if the user is harvesting and if so, the player should walk towards the BerryTree. However, the function `walkTowardsBerryTree` that is supposed to handle this logic is not implemented. Please implement this function to ensure the player moves towards the BerryTree when the user is harvesting. Keep up the good work!
I finished incorporating these changes.
🎉 Latest improvements to Sweep:
💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord
Checklist
- [X] `frontend/src/store.js` ✅ Commit [`0708ed6`](https://github.com/aj47/berigame/commit/0708ed606f3a4c49e4a4448c9609437a9525e663) - [X] `frontend/src/Components/3D/PlayerController.tsx` ✅ Commit [`f38fd55`](https://github.com/aj47/berigame/commit/f38fd5547b135e8f00ee6e3a760b81a5ddf1886b)