can you help me with shape collision
-
I've simulated gravity using Moveshape += Circ_Y Which moves it towards the ground like gravity but how do you make it collide with a box at the bottom of the screen?
-
You could use the distance function https://fuzearena.com/help/view/distance to find when the distance between two points in close enough to be a hit
Have a look at the "Fun with Shapes!" demo which has a Minigame at the end with shape collision
-
I'll try it, thank you for being very supportive.
-
If you're just wanting to see if that shape has reached a box, an if statement will work too:
if circY + radius > boxY + boxHeight and circX + radius > boxX and circX + radius < boxX + boxWidth then // do your collision stuff endif
This is dependent on where the origin point for your shapes are. If you're using the box() function, this top left.
The drawShape() functions used in the "Fun With Shapes" demo pointed out by @pianofire allow you to do all sorts of awesome things with shapes with ease. Well worth checking out! Some of the help pages for those functions are missing examples, but they're coming in a future update!