Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » pen tool collision
- MineTurte
- Scratcher
500+ posts
pen tool collision
Just repurpose a normal collision engine and add a pen to it. If you need help with that just ask. how do i make pen tool collision
Hope this helps!
15+ (not revealing age) girl. Pronouns are she/her.
Host of The Pi Counsel. Comment in studio to join.
Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well
If I helped you out consider following Juni-Bug!
Select this + shift + down arrow = view rest of signature
This is JuniperActias. AKA Moth mommy.
Signature gradients here
If you found this secret; reply with ‘uwu’ with absolutely no context
Host of The Pi Counsel. Comment in studio to join.
Front-end web developer & software programmer. I use JS, HTML, & CSS. Learning python3 right now.
Grammar fanatic as well
If I helped you out consider following Juni-Bug!
Select this + shift + down arrow = view rest of signature
This is JuniperActias. AKA Moth mommy.
Signature gradients here
If you found this secret; reply with ‘uwu’ with absolutely no context
- floppaisbad
- Scratcher
15 posts
pen tool collision
i have tried doing if touching color dont fall and stuff like that but that did not work
- sashimiricedev
- Scratcher
100+ posts
pen tool collision
If your project is 100% pen, you will need to use AABB collision, as the
Basically, in an AABB world, everything is a rectangle or square.
We can check if any face intersects the other.
AABB is kinda difficult to put in scratch, so this video might help.
https://www.youtube.com/watch?v=oOEnWQZIePs
<touching [ v] ?>is literally useless for pen.
Basically, in an AABB world, everything is a rectangle or square.
We can check if any face intersects the other.
AABB is kinda difficult to put in scratch, so this video might help.
https://www.youtube.com/watch?v=oOEnWQZIePs
forum helper
Forum Post Demos
I follow most of the discussions I post on, so feel free to reply back if you have any further questions.
- -stxllxr
- New to Scratch
100+ posts
pen tool collision
It may be to you, although once you understand it it's incredibly simple. I made the collision detection in 40 blocks AABB is kinda difficult to put in scratch, so this video might help. here, and it actually took longer to learn how to use the rectangle filler in the project than it did to make the collision detection.
How it works is basically it checks for if the first x of the second rectangle is bigger than the second x of the first rectange, and does the same for y. The if-elses are used to determine which rectange is first on the y and x axes, although there might be a better method.
Last edited by -stxllxr (April 7, 2024 20:40:03)
- SneakyDJ
- Scratcher
4 posts
pen tool collision
I searched Google and found this:
when green flag clicked
if <color [#6caed4] is touching [#1a86a7] ?> then
<<pen up> or <clear>>
end
Last edited by SneakyDJ (April 7, 2024 20:48:26)
- --CHA0S--
- Scratcher
100+ posts
pen tool collision
You could also use the distance formula and detect collisions that way. That’s how I do it at least
Hi
Trying to become a forum helper
- malicondii
- Scratcher
100+ posts
pen tool collision
That's only viable for circular collisions, the corners of squares and the longer, or shorter, sides of rectangles will be inaccurate, and good luck with irregular polygons lol. You could also use the distance formula and detect collisions that way. That’s how I do it at least
Last edited by malicondii (April 7, 2024 21:38:02)
- --CHA0S--
- Scratcher
100+ posts
pen tool collision
Fair enoughThat's only viable for circular collisions, the corners of squares and the longer, or shorter, sides of rectangles will be inaccurate, and good luck with irregular polygons lol. You could also use the distance formula and detect collisions that way. That’s how I do it at least
Hi
Trying to become a forum helper
- Discussion Forums
- » Help with Scripts
- » pen tool collision