Skip to content

SharkPool/Camera.js -- Add touch precision block, optimize, and improve code#2411

Merged
GarboMuffin merged 8 commits intomasterfrom
SharkPool-SP-patch-7
Mar 28, 2026
Merged

SharkPool/Camera.js -- Add touch precision block, optimize, and improve code#2411
GarboMuffin merged 8 commits intomasterfrom
SharkPool-SP-patch-7

Conversation

@SharkPool-SP
Copy link
Copy Markdown
Collaborator

@SharkPool-SP SharkPool-SP commented Feb 7, 2026

  • adds a block for precise collisions
  • optimizations with dirty checks
  • cleaner code
  • fix minor floating point issues
  • allow setting alpha color of the canvas

@github-actions github-actions Bot added the pr: change existing extension Pull requests that change an existing extension label Feb 7, 2026
@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

!format

@Brackets-Coder
Copy link
Copy Markdown
Contributor

Okay, I'll look into it when I have time

Copy link
Copy Markdown
Contributor

@Brackets-Coder Brackets-Coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick skim. Code looks better now, I just have to find time to test and make sure everything's still working

I don't have any older projects with this extension so I can't do much regression testing :/

Comment thread extensions/SharkPool/Camera.js
Comment thread extensions/SharkPool/Camera.js
@SharkPool-SP SharkPool-SP marked this pull request as ready for review March 3, 2026 04:35
@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

!format

@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

@Brackets-Coder Use this sb3 (rename .zip to .sb3) which has the old version. Try it out, notice the jitter.

New version of the extension is more optimized, and enabling precise touch mode fixes the jitter.

platfor.zip

@SharkPool-SP SharkPool-SP changed the title SharkPool/Camera.js -- Optimizations and code improvements SharkPool/Camera.js -- Add touch precision block, optimize, and improve code Mar 3, 2026
@RedMan13
Copy link
Copy Markdown
Contributor

RedMan13 commented Mar 3, 2026

i cant seem to unbind this sprite from the default camera, even though the block suggest i could

@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

i cant seem to unbind this sprite from the default camera, even though the block suggest i could

I could change that in this update

@RedMan13
Copy link
Copy Markdown
Contributor

RedMan13 commented Mar 3, 2026

image

i dont think unbinding from a camera the sprite isnt even bound too is supposed to reset to the default camera

@RedMan13
Copy link
Copy Markdown
Contributor

RedMan13 commented Mar 3, 2026

I could change that in this update

alr

@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

I could change that in this update

alr

I just hid the block since this block is technically just a bind block to the default camera.

@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

!format

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

The formatting bot didn't find any formatting issues. It currently only checks the extensions folder. The author or a maintainer can run terminal command 'npm run format' manually to format all files.

@RedMan13
Copy link
Copy Markdown
Contributor

RedMan13 commented Mar 3, 2026

I just hid the block since this block is technically just a bind block to the default camera.

alr, ig

Copy link
Copy Markdown
Contributor

@RedMan13 RedMan13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i cant see any issues, and the changes seem perfectly fine to me

@Brackets-Coder
Copy link
Copy Markdown
Contributor

@Brackets-Coder Use this sb3 (rename .zip to .sb3) which has the old version. Try it out, notice the jitter.

New version of the extension is more optimized, and enabling precise touch mode fixes the jitter.

platfor.zip

I'll get to you as soon as I can, may be a few days

@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

@Brackets-Coder Use this sb3 (rename .zip to .sb3) which has the old version. Try it out, notice the jitter.

New version of the extension is more optimized, and enabling precise touch mode fixes the jitter.

platfor.zip

I'll get to you as soon as I can, may be a few days

Few days later

@Brackets-Coder
Copy link
Copy Markdown
Contributor

I'll take a look now, thanks for the reminder

Copy link
Copy Markdown
Contributor

@Brackets-Coder Brackets-Coder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the sketchy platformer physics provided in the demo, the most recent commit of the camera extension looks good. Enabling the new touch precision block entirely mitigates the sketchy physics and makes it buttery smooth. Nice job.

  • I tested all modified functionality and found no bugs or unintuitive behavior.
    • I tested the provided demo project with the newly added block, I haven't yet manually confirmed that the other blocks (zoom, direction, etc). are still working as expected.
  • I believe a well-formed project using an older version of this extension will not be broken by this new version.
  • I have no additional concerns.

Below you can see that the player "bounces" off of the wall when constantly pressing D to move right into it. This only happens with the new precision mode enabled. It's better than clipping through the wall or bouncing to the top (which happens without it) but I was wondering if you could make the player not move in such circumstances? Is this a project limitation or extension limitation? I'm not familiar with how this extension works, so to be honest I'm not the best one to be reviewing this

video.webm

@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

Aside from the sketchy platformer physics provided in the demo, the most recent commit of the camera extension looks good. Enabling the new touch precision block entirely mitigates the sketchy physics and makes it buttery smooth. Nice job.

  • I tested all modified functionality and found no bugs or unintuitive behavior.

    • I tested the provided demo project with the newly added block, I haven't yet manually confirmed that the other blocks (zoom, direction, etc). are still working as expected.
  • I believe a well-formed project using an older version of this extension will not be broken by this new version.

  • I have no additional concerns.

Below you can see that the player "bounces" off of the wall when constantly pressing D to move right into it. This only happens with the new precision mode enabled. It's better than clipping through the wall or bouncing to the top (which happens without it) but I was wondering if you could make the player not move in such circumstances? Is this a project limitation or extension limitation? I'm not familiar with how this extension works, so to be honest I'm not the best one to be reviewing this

video.webm

That is not entirely an issue with the extension, it still happens when the zoom is at the default 100. You can barely see it but it does happen. It becomes more visible because of non-rounded camera xy values multiplied by the camera zoom

@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

!format

@Brackets-Coder
Copy link
Copy Markdown
Contributor

@SharkPool-SP can it wait until next week?

@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

@SharkPool-SP can it wait until next week?

Idk

@Brackets-Coder Brackets-Coder self-assigned this Mar 12, 2026
@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

@SharkPool-SP can it wait until next week?

Vro 🙏

Copy link
Copy Markdown
Contributor

@DogeisCut DogeisCut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I tested all modified functionality and found no bugs or unintuitive behavior.
  • I believe a well-formed project using an older version of this extension will not be broken by this new version.
  • I have no additional concerns.

@Brackets-Coder
Copy link
Copy Markdown
Contributor

@SharkPool-SP can it wait until next week?

Vro 🙏

Thx for the reminder I'll get it sometime this afternoon or tomorrow afternoon

@GarboMuffin
Copy link
Copy Markdown
Member

yolo

@GarboMuffin GarboMuffin merged commit 2bb1280 into master Mar 28, 2026
4 checks passed
@Brackets-Coder
Copy link
Copy Markdown
Contributor

Nevermind I won't get it this afternoon then

@SharkPool-SP
Copy link
Copy Markdown
Collaborator Author

yolo

Garbs finally understands life 🥹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: change existing extension Pull requests that change an existing extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants