[Home]History of VelocityTrick

Robo Home | Changes | Preferences | AllPages


Revision 3 . . May 3, 2006 23:23 EST by Xero
Revision 2 . . April 27, 2006 14:17 EST by CMU-179539.RES.cmu.edu [comment]
  

Difference (from prior major revision) (no other diffs)

Changed: 1,25c1,16
A failed experiment by Xero to see if velocity changes messed up guns. It ended up not only messing up the enemy gun but messing up my WaveSurfing. Here is the (now obsolete) code which goes in your onScannedRobot:
double maxVel = Math.random();
if(maxVel < .1) {
maxVel = 4;
}
else if(maxVel < .5) {
maxVel = 5;
}
else if(maxVel < .6) {
maxVel = 3;
}
else if(maxVel < .4) {
maxVel = 6;
}
else if(maxVel < .7) {
maxVel = 8;
}
else if(maxVel < .9) {
maxVel = 7;
}
else if(maxVel > .8) {
maxVel = 8;
}
out.println("Max velocity:" + maxVel);
setMaxVelocity?(maxVel);
An experiment by Xero to see if velocity changes messed up guns.
The code from part of Python's run() method is here. This code is changed from the original Python run method to be more pluggable.
do {
doScanner();
velocityChange++;
if(velocityChange >= 100) {
velocityChange = 0;
double maxVel=Math.random()*9+3;
if(maxVel > 8) {
maxVel = 7.49;
}
out.println("Max velocity:" + maxVel);
setMaxVelocity?(maxVel);
}
//etc.
while(true);

Added: 26a18,19



Robo Home | Changes | Preferences | AllPages
Search: