pen tool collision
id: 752710
category: Help with Scripts
posts: 9
floppaisbad
loading
how do i make pen tool collision
MineTurte
loading
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!
floppaisbad
loading
i have tried doing if touching color dont fall and stuff like that but that did not work
sashimiricedev
loading
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
-stxllxr
loading
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.
SneakyDJ
loading
I searched Google and found this:
when green flag clicked
if <color [#6caed4] is touching [#1a86a7] ?> then
<<pen up> or <clear>>
end
--CHA0S--
loading
You could also use the distance formula and detect collisions that way. That’s how I do it at least
malicondii
loading
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
--CHA0S--
loading
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