[Home]GJR

Robo Home | Changes | Preferences | AllPages

I'm a robocode newbie, trying to remember my high-school trig. :-)

welcome to the wiki. --deathcon

Questions

I have a question already. I'm working on putting anti-gravity movement into one of my test bots. I think I've got the basics working, but my bot seems to like to run into walls, and then stay there - despite the walls having repulsive force. This happens even in one-on-one: my bot will sometimes run away from the enemy until it hits a wall, and then stay there for the rest of the round. Can anyone tell me where my error is? The code below is from my run method.

...
		while(true) {
			Iterator keys = enemies.keySet().iterator();
			double xForce = 0.0;
			double yForce = 0.0;
			while( keys.hasNext() ) {
				Enemy enemy = (Enemy) enemies.get(keys.next());
				

			}
		
			execute();
		}
...


Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited November 9, 2006 14:15 EST by svr2.pace.k12.mi.us (diff)
Search: