[Home]History of Simmons

Robo Home | Changes | Preferences | AllPages


Revision 9 . . (edit) February 23, 2004 4:24 EST by Qetu
Revision 8 . . December 21, 2003 23:39 EST by Dan
Revision 7 . . December 21, 2003 22:45 EST by Tango
  

Difference (from prior major revision) (minor diff, author diff)

Changed: 52c52,69
If those really are your numbers then you should expect to hug the walls. This in ANTIgravity movement, because it repels. Enemy bots and walls should both repel, the way you have it is bots repel and walls attract. Make the walls force negative, and it should work. -- Tango
If those really are your numbers then you should expect to hug the walls. This in ANTIgravity movement, because it repels. Enemy bots and walls should both repel, the way you have it is bots repel and walls attract. Make the walls force negative, and it should work. -- Tango

No, if you look at Hanji/AGravEngine and Hanji/GravPoint, both of which are used in my bot, the wall force, when positive repels, and the grav points force are repulsive when negative. It is a small thing with the math, you change the update method, ie switch around the +/- operators in some places, they can be set so both can be positive or negative repulsive.

This is the math:


//this calculates the force the gravpoint exerts on the bot
xForce += force * Math.sin(angle);
yForce -= force * Math.cos(angle);
//this calculates the force the walls exert on the bot
xForce -= wallForce/Math.pow(curX, wallDropoff);
xForce += wallForce/Math.pow(width-curX, wallDropoff);
yForce += wallForce/Math.pow(height-curY, wallDropoff);
yForce -= wallForce/Math.pow(curY, wallDropoff);

As you can see, if you were to switch the +'s and -'s in, say the gravpoint section, positive would become repulsive, negative attractive. The same thing is in Hanji's comment's for those classes. Burk3, Good Luck. --Dan



Red vs Blue rules :D -- Qetu

Robo Home | Changes | Preferences | AllPages
Search: