Josh
2010-01-30 05:08:08 UTC
Hello all,
I've got a question.
Look at this code:
while true
turnRight(90);
ahead(5000);
Say I have a onScannedRobotEvent method that fires a bullet, and at the
bottom, there is a call to method scan.
Say at the line peek = true
the robot sees another robot. And say that the other robot was right in
front, so that even without scan() my robot will detect an enemy.
If the onScannedRobot method produced a ScannedRobot event every time it
ran,
does that mean the ahead(5000) will not execute until the enemy robot is
either destroyed or moves out of the way?
PS you can see this concept at work in Sample.Walls.java, though I can't
say I exactly understand it
best regards,
josh
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)
<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
I've got a question.
Look at this code:
while true
turnRight(90);
ahead(5000);
Say I have a onScannedRobotEvent method that fires a bullet, and at the
bottom, there is a call to method scan.
Say at the line peek = true
the robot sees another robot. And say that the other robot was right in
front, so that even without scan() my robot will detect an enemy.
If the onScannedRobot method produced a ScannedRobot event every time it
ran,
does that mean the ahead(5000) will not execute until the enemy robot is
either destroyed or moves out of the way?
PS you can see this concept at work in Sample.Walls.java, though I can't
say I exactly understand it
best regards,
josh
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)
<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/