Robocode basics

2,703
-1

Published on

Published in: Education
1 Comment
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
2,703
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
48
Comments
1
Likes
2
Embeds 0
No embeds

No notes for slide

Robocode basics

  1. 1. Robocode
Basics
 ubolonton

  2. 2. Coordinates
and
Direc3ons

  3. 3. 3
Parts
of
a
Robot
 •  All
of
them
can
rotate
independently

  4. 4. Movement
 •  Time
is
measured
in
turns
(“3cks”).
 •  Distance
is
measured
in
pixels.
 •  Robot
can
move
no
farther
than
8
pixels
per
 turn.
If
commanded
to
move
farther,
it
will
 take
several
turns.
 •  The
same
goes
for
turning
of
body
parts.


  5. 5. Firing
 •  Bullets
can
have
power
of
0.1‐3
 •  Firing
a
bullet
costs
an
equal
amount
of
HP
 •  But
a
hit
“leechs”
back
HP
 •  Weak
bullets
move
faster

  6. 6. Coding
 •  Main
loop:
what
to
do
each
turn
 •  Events:
what
to
do
when
something
happens
 – onScannedRobot
 – onHitByBullet
 – onHitRobot
 – …
 •  See
the
javadoc
directory
in
the
installa3on
 folder
for
reference

  7. 7. Some
angles
from
last
slides
explained

  8. 8. Trick:
Linear
Aim‐ahead
 •  Assume
the
enemy
moves
in
straight
line
with
 constant
speed
(very
effec3ve
against
human
 player)

  9. 9. Resources
 •  hYp://robowiki.net/:
community
wiki
with
a
lot
 of
informa3on
 •  hYp://robocode.sourceforge.net/ developerWorks.php:
links
to
ar3cles
from
IBM
 •  hYp://rmitc.org/:
RMITC
official
page,
with
 ar3cles
and
source
code
of
last
semester
robots
 •  The
javadoc
folder
in
your
robocode
installa3on
 directory


×