How to create circle around Myrobot.Need suggestion

View: New views
5 Messages — Rating Filter:   Alert me  

How to create circle around Myrobot.Need suggestion

by asherbaig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi developers,
              I want to know that how it could be possible to add
circle around myrobot.Any idea how to do that ?


Re: How to create circle around Myrobot.Need suggestion

by flemmingnlarsen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You should have a look at my tutorial here:

http://testwiki.roborumble.org/w/index.php?title=Robocode/Graphical_Debugging

You should also have a look on the two sample robots:
- sample.PaintingRobot
- sample.Interactive

Regards,
- Flemming


--- In Robocode@..., "asherbaig" <devilvsevil@...> wrote:
>
> Hi developers,
>               I want to know that how it could be possible to add
> circle around myrobot.Any idea how to do that ?
>



Re: How to create circle around Myrobot.Need suggestion

by flemmingnlarsen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

You should have a look on my tutorial about Graphics Debugging here:

http://testwiki.roborumble.org/w/index.php?title=Robocode/Graphical_Debugging

You should also have a look on the source files for these two sample
robots:
- sample.PaintingRobot
- sample.Interactive

Regards,
- Flemming


--- In Robocode@..., "asherbaig" <devilvsevil@...> wrote:
>
> Hi developers,
>               I want to know that how it could be possible to add
> circle around myrobot.Any idea how to do that ?
>



Re: How to create circle around Myrobot.Need suggestion

by asherbaig :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

--- In Robocode@..., "flemmingnlarsen"
<flemming.n.larsen@...> wrote:
>
> You should have a look on my tutorial about Graphics Debugging here:
>
>
http://testwiki.roborumble.org/w/index.php?title=Robocode/Graphical_Debugging

>
> You should also have a look on the source files for these two sample
> robots:
> - sample.PaintingRobot
> - sample.Interactive
>
> Regards,
> - Flemming
>
>
> --- In Robocode@..., "asherbaig" <devilvsevil@> wrote:
> >
> > Hi developers,
> >               I want to know that how it could be possible to add
> > circle around myrobot.Any idea how to do that ?
> >
>



Re: How to create circle around Myrobot.Need suggestion

by Marko Väljaots :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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