|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EDU.gatech.cc.is.simulation.AttractorSim | +--EDU.gatech.cc.is.simulation.GolfBallSim
A golfball for RoboCup Soccer.
Introduction
GolfBallSim implements a golf ball for RoboCup
soccer simulations. The ball is also the scorekeeper and
the referee; after all who would know better whether a
scoring event occured?
A "shot clock" keeps track of how long since a scoring event occured. If it times-out, the ball is reset to the center of the field.
Copyright (c)2000 Tucker Balch
Field Summary | |
static boolean |
DEBUG
|
protected Vec2 |
velocity
|
Fields inherited from class EDU.gatech.cc.is.simulation.AttractorSim |
all_objects,
background,
bottom,
DEBUG,
deposited,
foreground,
left,
picked_up,
position,
RADIUS,
rando,
right,
seed,
top,
unique_id,
visionclass |
Constructor Summary | |
GolfBallSim()
Instantiate a golf ball. |
Method Summary | |
void |
draw(java.awt.Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
Draw the golf ball and display score and shotclock. |
boolean |
eastJustScored()
True if it is east just scored. |
boolean |
eastKickOff()
True if it is east's turn to kick off. |
boolean |
playBall()
True if the game is underway. |
void |
push(Vec2 d,
Vec2 v)
Handle a push. |
void |
takeStep(long time_increment,
SimulatedObject[] all_objs)
Take a simulated step; |
boolean |
westJustScored()
True if it is west just scored. |
boolean |
westKickOff()
True if it is west's turn to kick off. |
Methods inherited from class EDU.gatech.cc.is.simulation.AttractorSim |
checkCollision,
checkCollision,
clearTrail,
draw,
drawIcon,
drawID,
drawState,
drawTrail,
getCenter,
getClosestPoint,
getID,
getPosition,
getVisionClass,
init,
isObstacle,
isPickupable,
isPushable,
pickUp,
putDown,
quit,
receive,
setID,
setTrailLength,
setVisionClass |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected Vec2 velocity
public static final boolean DEBUG
Constructor Detail |
public GolfBallSim()
Method Detail |
public void takeStep(long time_increment, SimulatedObject[] all_objs)
time_increment
- how much time has elapsed since
the last call.all_objects
- the other objects in the simulation.public void push(Vec2 d, Vec2 v)
d
- the direction and distance of the push.v
- the velocity of the push.public void draw(java.awt.Graphics g, int w, int h, double t, double b, double l, double r)
g
- graphics area to draw the object.w
- the width in pixels of g.h
- the height in pixels of g.t
- the y coordinate represented by the top boundary of
the drawing area.b
- the y coordinate represented by the bottom boundary of
the drawing area.l
- the x coordinate represented by the left boundary of
the drawing area.r
- the x coordinate represented by the right boundary of
the drawing area.public boolean playBall()
public boolean eastKickOff()
public boolean westKickOff()
public boolean westJustScored()
public boolean eastJustScored()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |