onMouseDown() inside any of the obstacle circles increases their size. Once a maximum size is reached, they are scaled back. Both are accomplished by a simple Obstacle[x].scale(1.2) function.

I tried refactoring the BallBounceReflection() function using getNormalAt(), but that failed miserably. I tried this because I was still getting a bug whereby the BB[]'s sometimes broke through the Outside Circle. I think I fixed this by backing the BB[]'s up one increment's worth of movement before applying the new vector returned by BallBounceReflection()

OK, still no luck.

And since I'll likely never figure this out, I created an unseen secondary SafetyCircle around the outer circle. And if any ball goes outside of this, it is sent back to the starting position, sight unseen.

And unless I think of something overnight, that might be that for this project.
(Which it was and it is, as from here I started doing paper.js tutorials to fill in the missing parts of my knowledge base.)

Previous      Brett Code Index    Back to First Page of The Octogon Wars Seris

Brett Code - paper.js Tutorials

Octogon Wars
Copyright © 2013 Brett Paufler