Open bmoren opened 4 years ago
If we move the examples to md files i think it might be worth it to start using doc generation
like add all the examples in a comment above the function definition
1) keep the docs close to the function within the code and makes for easy search and replace
2) doc generators automatically generate lists of functions with links to examples out of the box
//###########collidePointCircle###########
// #### collidePointCircle()
// ###### collidePointCircle(pointX, pointY, circleX, circleY, diameter)
// point to circle collision in 2D. Assumes ellipseMode(CENTER);
// var hit = false;
// function setup() {
// ......
// }
// function draw() {
// ......
// hit = collidePointCircle(mouseX,mouseY,200,200,100)
// ......
// }
//--------------------
p5.prototype.collidePointCircle = function (x, y, cx, cy, d) {
//2d
if( this.dist(x,y,cx,cy) <= d/2 ){
return true;
}
return false;
};
is this a good idea? maybe a series of md files, or a gh-pages documentation instead?
I think this would clear up the read-me a bit and allow for some more in-depth examples.