.TH xrobots "" "" "X Applications"
.PC "Fight off villainous robots"
.B /usr/games/xrobots 
.PP
.B xrobots
is an X implementation of the old ``robots'' game, such as that implemented
on the Atari ST under the name ``daleks''.
Fans of the TV show
.I "Dr. Who"
will recognize the scenario:
The hero, represented by a ``smiley symbol'' must dodge evil robots
that pursue him around the window.
The window is divided into an invisible grid; you move the hero
one cell on the grid, and the robots each move one square in turn.
If two robots crash into each other, they turn into a rock; if a robot crashes
into a rock, it too turns into a rock.
The more robots turn into rocks, the more points you get.
If you petrify all robots on a given screen, a new screen is drawn with
more robots than before.
.PP
The hero is surrounded by eight small dots.
To move the hero, click the right-mouse button; the hero moves one cell
in the direction of the dot that lies closest to the mouse cursor.
To select the direction of movement, click the left-mouse button.
When you click on the hero himself (or on the button labelled
.IR Wait ),
he does not move.
.PP
Clicking on the button labelled
.K Teleport
moves the hero to a randomly selected portion of the window.
This is dangerous, as the hero can land near a robot and be ``killed''.
.PP
The hero also has a ``sonic screwdriver,'' which wipes out any robots
within close proximity.
You can fire the screwdriver once per screen-ful of robots.
To fire it, click the button labelled
.KR Sonic_Screwdriver .
.PP
For each robot that you petrify, you get ten points.
In addition, you get bonus points for every time you teleport (and are not
``killed''), and for clearing the screen of robots without using the
sonic screwdriver.
.PP
You can also use keyboard commands to play
.BR xrobots ,
as follows:
.IP \fBh\fR 0.3i
Move one cell to the left.
.IS \fBH\fR
Move as far as possible to the left.
.IP \fBl\fR
Move one cell to the right.
.IS \fBL\fR
Move as far as possible to the right.
.IP \fBk\fR
Move one cell up.
.IS \fBK\fR
Move up as far as possible.
.IP \fBj\fR
Move one cell down.
.IS \fBJ\fR
Move down as far as possible.
.IP \fBy\fR
Move one cell diagnonally up and to the left.
.IS \fBY\fR
Move as far as possible diagnonally up and to the left.
.IP \fBu\fR
Move one cell diagnonally up and to the right.
.IS \fBu\fR
Move as far as possible diagnonally up and to the right.
.IP \fBb\fR
Move one cell diagnonally down and to the left.
.IS \fBb\fR
Move as far as possible diagnonally down and to the left.
.IP \fBn\fR
Move one cell diagnonally down and to the right.
.IS \fBn\fR
Move as far as possible diagnonally down and to the right.
.IP \fB&\fR
.IS \fB<spacebar>\fR
Do nothing for one turn.
.IP \fBt\fR
Teleport to a random location.
.IP \fBw\fR
Wait until the robots reach you.
.IP \fBs\fR
Fire the sonic screwdriver.
.IP \fB<ctrl-C>\fR
Quit.
.SH Resources
.B xrobots
uses the X Toolkit and
takes advantage of the toolkit's resources and translation schemes.  
The following gives the resources that
.B xrobots
uses and that you can set in file
.BR $HOME/.Xdefaults :
.IP \fBxrobots.autoteleport\fR
If set to
.BR true ,
you teleport automatically when there is no other option.
.B xrobots
does not autoteleport if the sonic screwdriver has not been used.
The default is
.BR false .
.IP \fBxrobots.autoteleportalways\fR
This is similar to
.BR autoteleport ,
but teleports automatically even if you have a sonic screwdriver available.
The default is
.BR false .
.IP \fBxrobots.diewaiting\fR
Setting this to true adds a little risk to your life and makes the
game play a little more like BSD robots.
The default is
.BR false .
.IP \fBxrobots.scorefile\fR
This holds the path name of the score file.
.B xrobots
will create this file if it does not exist.
The default is
.BR /usr/games/lib/xrobots_scores .
The name recorded in the score file taken from the environmental variable
.BR USER .
.IP \fBxrobots.showmovement\fR
If set to
.BR false ,
.B xrobots
does not show intermediate movements.
This may be useable for very slow servers or very fast players.
The default is
.BR true .
.IP \fBxrobots.spiffy\fR
If set to
.BR false ,
some of the graphics will not be shown.
This is helpful for slow servers.
The default is
.BR true .
.PP
In addition
you can change all key bindings.
The following gives
a sample set of translation bindings that you can modify to your preferences:
.DM
xrobots*Translations:   #augment     \en\e 
<Btn1Up>:    move()             \en\e 
:<Key>u:     move(right, up)    \en\e 
:<Key>l:     move(right)        \en\e 
:<Key>n:     move(right, down)  \en\e 
:<Key>y:     move(left, up)     \en\e 
:<Key>h:     move(left)         \en\e 
:<Key>b:     move(left, down)   \en\e 
:<Key>k:     move(up)           \en\e 
:<Key>j:     move(down)         \en\e 
:<Key>U:     jump(right, up)    \en\e 
:<Key>L:     jump(right)        \en\e 
:<Key>N:     jump(right, down)  \en\e 
:<Key>Y:     jump(left, up)     \en\e 
:<Key>H:     jump(left)         \en\e 
:<Key>B:     jump(left, down)   \en\e 
:<Key>K:     jump(up)           \en\e 
:<Key>J:     jump(down)         \en\e 
<Key>.:      move(nowhere)      \en\e 
<Key>\e\e :    move(nowhere)      \en\e 
<Btn2Up>:    go_here()          \en\e 
<Btn3Up>:    wait()             \en\e 
<Key>s:      sonic()            \en\e 
<Key>t:      teleport()         \en\e 
<Key>w:      wait()             \en\e 
<Key>z:      new_game()         \en\e 
Ctrl<Key>c:  quit()
.DE
.SH Actions
The following describes each action that can be referenced via translations,
and what it does:
.IP \fBmove()\fR
When invoked with no parameters, this action uses the relative position of the
mouse pointer to determine the direction in which to go.
Otherwise, it moves the hero in the direction indicated by the combination
of its arguments, which can be any of
.BR left ,
.BR right ,
.BR up ,
.BR down ,
and
.BR nowhere .
If
.B nowhere
is used, the hero's icon stands still while the robots take their turn.
.IP \fBjump()\fR
This action does the same thing as
.BR move() ,
except it moves the hero in the given direction until it cannot move
any farther.
This is used in the default translations when a key is shifted into upper case.
.IP \fBgo_here()\fR
This action directs the hero's icon to the location where the
mouse button was released.
Of course, the robots chase the hero;
if doom is impending,
.B go_here()
stops.
.IP \fBwait()\fR
Make the robots move until they are breathing right down your neck.
.IP \fBsonic()\fR
Invoke the sonic screwdriver.
.IP \fBtransport()\fR
Invokes the teleporter.
.IP \fBnew_game()\fR
Begin a new game.
.IP \fBquit()\fR
Quit
.BR xrobots ,
and close its window.
.SH Options
In addition to the normal XToolkit options,
.B xrobots
recognizes the following command-line options:
.IP \fBautoteleport\fR
Set the resource
.BR autoteleport .
.IS \fBautoteleportalways\fR
Set the resource
.BR autoteleportalways .
.IS \fBdiewaiting\fR
Set the resource
.BR diewaiting .
.IS \fBshowmovement\fR
Set the resource
.BR showmovement .
.IS \fBscorefile\fR
Set the resource
.BR scorefile .
.IS \fBspiffy\fR
Set the resource
.BR spiffy .
.SH "See Also"
.B
X applications
.R
.SH Notes
.II "Warkentine, Brian"
.B xrobots
was written by Brian Warkentine (brianw@Sun.COM).
