Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Robocode basics

3,420 views

Published on

Published in: Education

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


×