« Return to Thread: How to create circle around Myrobot.Need suggestion

Re: How to create circle around Myrobot.Need suggestion

by Marko Väljaots :: Rate this Message:

Reply to Author | View in Thread

Hi,

take a look at PaintingRobot.java
There is a little function, that does exactly what you are looking for.

         /**
         * Paint a red circle around our PaintingRobot
         */
        public void onPaint(Graphics2D g) {
                g.setColor(Color.red);
                g.drawOval((int) (getX() - 50), (int) (getY() - 50), 100, 100);
                g.setColor(new Color(0, 0xFF, 0, 30));
                g.fillOval((int) (getX() - 60), (int) (getY() - 60), 120, 120);
        }



--- In Robocode@..., "asherbaig" <devilvsevil@...> wrote:

>
> Hi Developers,
>
> I know it's very easy for you but for me its hard to undertstand.
>
> As in interactive i couldn't found any information about creating a
> circle around it.
> Please help me where i have to put code in interactive to add circle
> around it.
> And if you can provide me the code for creating circle around
> sample.interactive.I will deeply thankful to you.:)
>  
> Thanks


 « Return to Thread: How to create circle around Myrobot.Need suggestion