aj47 / berigame

berigame.com
2 stars 1 forks source link

Sweep: make it so that when user clicked "Harvest" on the BerryTree, after the player walks to the tree, it should start playing the "RightHook" animation. make sure to make a new state setUserHarvesting in store.js . make sure to only play the animation when player distance is in range, similar to how the animation is played when userAttacking is true. #2

Closed aj47 closed 1 year ago

aj47 commented 1 year ago
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)
sweep-ai[bot] commented 1 year ago

Here's the PR! https://github.com/aj47/berigame/pull/4.

⚡ Sweep Free Trial: I'm creating this ticket using GPT-4. You have 4 GPT-4 tickets left for the month and 2 for the day. For more GPT-4 tickets, visit [our payment portal.](https://buy.stripe.com/6oE5npbGVbhC97afZ4)

Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/aj47/berigame/blob/ecf8d8d665641376731c5e141a736188b1483a31/frontend/src/store.js#L1-L86 https://github.com/aj47/berigame/blob/ecf8d8d665641376731c5e141a736188b1483a31/landing-page/downloaded-assets/doc/assets/vendor/jstree/src/jstree.dnd.js#L2-L120 https://github.com/aj47/berigame/blob/ecf8d8d665641376731c5e141a736188b1483a31/landing-page/downloaded-assets/doc/assets/vendor/jstree/src/jstree.search.js#L2-L162 https://github.com/aj47/berigame/blob/ecf8d8d665641376731c5e141a736188b1483a31/frontend/src/Components/3D/PlayerController.tsx#L39-L207 https://github.com/aj47/berigame/blob/ecf8d8d665641376731c5e141a736188b1483a31/landing-page/downloaded-assets/doc/assets/vendor/jstree/src/jstree.dnd.js#L599-L661

Step 2: ⌨️ Coding

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

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


Step 3: 🔁 Code Review

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