The ball bounces, though not exactly as I would like.
The key function here is getDirectedAngle().
Points have angles in paperJS. Who would have thought?
Next step is trying to understand how the angles are computed and
implemented, but at least the ball stays in the bounds. So, maybe we're
real-real close.
Or if that's not all clear.
VR.angle = VectorRay.getDirectedAngle(VR);
VR is the Ray that controls the Bouncing Ball's (BB) movement.
VectorRay is the Ray from the Perimeter to the Center (OctoPer - CP)
BB.position += VR;
This is called 60x a minute by onFrame() to update BB's position
Or, of course, one could always look at the code, but at this point,
it's pretty scrambled. No sense making it look pretty until I get it to
do what I want it to do.
Previous Brett Code Index Next in Series
OctoWars Project
Copyright © 2013 Brett Paufler