p5.collide2D assumes the default p5.js rectMode(CORNER) and ellipseMode(CENTER).
All p5.collide2D functions return
true if the specified geometry is colliding and
false if they are not.
To include the library via a CDN, add the library's CDN link using a
<script> tag inside the
index.html file within your project.
<!-- This enables the p5.js core library (automatically added within the p5.js web editor). You'll need to include the core p5.js before using p5.collide2D. --> <script defer src="https://unpkg.com/p5"></script> <!-- Includes the p5.collide2D addon library --> <script defer src="https://unpkg.com/p5.collide2d"></script>
p5.collide2D supports vector version of all functions. Use the function names below with
Vector added on to the name to utilize the vector version of the function. The function's arguments will then take in vectors instead of x/y values. Each of the examples below has a commented example to demonstrate vector usage. We will be updating the documentation and examples in the future to make this distinction more clear. This in no way affects the original functionality of the library.