asherbaig
2008-12-17 17:06:02 UTC
Hi,Thanks for your help.
In my robot i have added the given below features in order to drawOval
around my target but it is not working.Please help me solving this issue.
Thanks,
Asher
public void drawTarget
(Graphics2D g, Color color,
String name,Point2D point) {
g.setColor(color);
double x = point.getX();
double y = point.getY();
g.drawString(name,(float)x+10,(float)y+10);
g.drawLine((int)x, (int) y+5, (int) y+15, aimX);
g.drawLine((int)x, (int) y+5, (int) y-15,aimY);
g.drawLine((int)x+5, (int) y, (int) y,aimX);
g.drawLine((int)x-5, (int) 5, (int) y,aimY);
g.drawOval(
(int) x-10,
(int)y-10,
(int)20,
(int)20);
}
------------------------------------
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:
mailto:Robocode-***@yahoogroups.com
mailto: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/
In my robot i have added the given below features in order to drawOval
around my target but it is not working.Please help me solving this issue.
Thanks,
Asher
public void drawTarget
(Graphics2D g, Color color,
String name,Point2D point) {
g.setColor(color);
double x = point.getX();
double y = point.getY();
g.drawString(name,(float)x+10,(float)y+10);
g.drawLine((int)x, (int) y+5, (int) y+15, aimX);
g.drawLine((int)x, (int) y+5, (int) y-15,aimY);
g.drawLine((int)x+5, (int) y, (int) y,aimX);
g.drawLine((int)x-5, (int) 5, (int) y,aimY);
g.drawOval(
(int) x-10,
(int)y-10,
(int)20,
(int)20);
}
------------------------------------
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:
mailto:Robocode-***@yahoogroups.com
mailto: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/