![]() |
![]()
| ![]() |
![]()
NAMExmris - video game for X SYNOPSISxmris [-option ...] [-toolkitoption ...] xmsit [-option ...] [-toolkitoption ...] DESCRIPTIONMr Is is a version of the Mr Do video arcade game for the X Window System. You control a gnome, who can walk around a garden, along paths already marked, or create new paths wherever you wish. You also have a ball, which can be thrown in the direction you're facing, towards the gnome's feet. Points are scored for collecting cherries (if you collect eight cherries without stopping or pushing an apple, you get a bonus), killing monsters (by squashing them, or throwing the ball at them), and collecting the prize left when all the monsters have come out of their den. Extra lives are obtained by killing all the 'EXTRA' monsters at the top of the garden, so that the letters change from stippled to solid (or grey to black or white, for colour). One of these comes out on its own every 5000 points. When you collect the prize, the normal monsters freeze, and an extra monster emerges, along with three drones. Killing the letter monster will kill the drones too. When the three drones are dead, the normal monsters wake up and things go faster. When all the normal monsters are killed, or all the cherries collected, or you have got the final extra monster, you advance to the next garden. You can kill the monsters by throwing the ball at them, or dropping the apples on them. You get more points for squashing them, and the more you squash in one go, the more points you get. The extra monster, and its drones, can eat the apples, provided that they're walking towards the apple. You die by colliding with a monster (unless its eating an apple, in which case no harm is done), or by being squashed by a falling apple. Sometimes a falling apple will break open to reveal a diamond. The points scores are scaled by the game speed, (see below). Your score may be immortalized in the all time best scores and/or the best of the day scores, and/or your own personal best scores. If your score was added to the best of the day after 21:00, it is kept until noon the next day, otherwise it will be removed at midnight. There is only one entry per user in the all time best and the best of the day tables. There are two load lines at the bottom edge of the window. One shows the frame time ratio and grows from left to right. The other shows the frame loading and grows from right to left. Note that these two lines can overlap, and are drawn with xor plotting. You can tell which is which, because the frame loading line alters on a frame by frame basis, whereas the frame time ratio only alters occasionally. The frame load line grows by one pixel for every frame which took longer to animate than there was allotted time, and is shrunk by one pixel for each frame which is animated in time. The frame time ratio shows the actual frame time, relative to the the ideal frame time. For a frame time ratio of r, the line is 1 - 1 / r the width of the window. Ie, for frame time ratio of 3 (one third speed) it covers two thirds of the window width. The frame time ratio is a long time average of the real frame times. It is used to scale the points scored in the game. The higher the ratio, the lower the score, thus making heterogeneous comparisons possible. The score scaling is biased towards lower frame ratios, so you can't get a higher score just by making the game slower. If your system becomes heavily loaded, you can pause the game, to prevent the frame time ratio being updated. When the frame load line diminishes, you can resume the game. Because an interrupt is used to control the frame rate, the animation is reasonably smooth. Though sometimes busywaiting will be needed to get the best results. The game works best with all other processes asleep. If another process gets too much processor time, the animation will be jerky, and the load line will start to grow. You probably want to position the pointer at the bottom of the window, so that it doesn't interfere with the play area. You'll notice it flicker, if one of the sprites moves under it. The game is controlled from the keyboard. All the key bindings can
be changed by the toolkit application resource mechanism, or during one of
the demonstration screens. There are four direction keys, known as up, down,
left and right and the ball can be thrown with the throw key. Because the
paths are aligned to a matrix, it is only possible to go in any direction at
intersections. Elsewhere you can either go horizontally or go vertically.
Pressing more than one direction key will turn the gnome appropriately at
the next intersection, so you can go round corners by pressing the new
direction key before releasing the old one. If you press a single direction
key to go in an impossible direction (ie not at an intersection), the gnome
will either continue in the direction it was already going, or, if
stationary, move towards the nearest intersection. As an example, suppose
you're going left and want to go up at the next intersection, the sequence
would be,
The game can be paused by iconizing it with the iconize key (when your boss walks in), or by losing the keyboard focus, or by pressing the pause key. When de-iconized, the game remains paused. To continue, press the throw key. When paused, you can abort the current game by pressing the quit key. If the game is displaying the demonstration screens, the quit key will quit the game, and pause key will cycle onto the next demonstration screen. During the score table display, the direction keys can be used to change to a different score table. Up or right cycle forwards and down or left cycle backwards. During the garden demonstration, the direction keys can be used to select a different garden. If you start the game from that new garden, you will start at that level, but not score anything. During the game there are several information screens and pauses, these can be skipped by pressing the throw key. The keys can be changed by using the keyboard key. Each logical key name is prompted for, and you can select a new key binding by pressing the one you want. Pressing the throw key will keep the binding for that particular key (remember the throw key may change half way through this process). You cannot map one key onto two functions, Mr Is will wait until you give an unambiguous set of keys. Key bindings set this way will be forgotten when Mr Is terminates. To permanently set the key bindings, you will have to the the X resources. Mr Is will use colour sprites, if the visual permits it (has a colour map size of more than 15, and you haven't forced monochrome). All the colours bar black and white are user definable. There are four sets, one for each of the four combinations of gender and swap flag. The colours are allocated in reverse order of their distance in colour space, from currently allocated colours (the most distant colours are allocated first). That way, if allocation fails because the colour map is full, an allocated substitute colour, which is nearest the desired colour, can be used and the allocated colours are kept maximally distant. You can limit the number of distinct colours with the -distinct option. A warning message is sent to stderr, if a colour allocation fails. The -colours argument shows how these are allocated, and -help -colours can be used to get the colour resource names. OPTIONSMr Is accepts the standard X Toolkit options, as well as these.
APPLICATION RESOURCESMr Is uses the X toolkit application resource mechanism for
setting up the environment. Application resource items start with 'Xmris'.
The resource name can be derived from the given resource class by
decapitalizing it. For example 'cherryStalk' is the resource name for the
class 'cherryStalk'. The following classes are used (choices in '{}' and
defaults in '[]'.)
For example, if you want to use the arrow keys, the following will
work
In addition, you have the normal resources such as '*Font'. Normally the cursor is invisible in the Mr Is window. You can force a cursor to be shown by setting the "Xmris*cursorName" resource to a named cursor. COLOUR RESOURCESThere are many colour name defaults. You can specify different ones for the four combinations of gender and swap resources, or use the same for some combinations. There is no reason why all these cannot be different colours, but note that the more unique colours you define, the more colour map entries you will use up. The colours black and white are already known about, but because of the way X parses hex colour names, I have programmed white as #FF00FF00FF00 (what #FFFFFF expands to), not #FFFFFFFFFFFF (what I think #FFFFFF should expand to). This means that if you specify a white colour to more than 8 bit accuracy, a new colour will be allocated. (This is a bug.) Of course, you can specify the colours by name ('NavajoWhite'), so long as X can grok it by searching your colour database. Most of the sprites have a black edge to them on the unswapped colour scheme, this gives comic like sprites. This edge is not included for the swap colour scheme, and the sprite's colours go right up to the sprite's edge. Most of the sprites will be surrounded by a halo of the background colour, so that they don't blend in with each other, when crossing. Another thing to watch out is contrast compensation. Because of eye physiology, colours can look different, depending on the surrounding colours, and light colours look brighter on dark backgrounds than they do on light ones. A particular case of the former is if pink is used for the player's face. On white backgrounds pink looks alright, but on dark backgrounds the pink can look quite brown, and must be brightened up, if you still want it to look pink. The latter effect means that the blue used for the drones is bright for a dark background and darker for a light background. There is no requirement that those colours with a specific colour in their name, need actually be a shade of that colour. For example GreenBack could be #A020F0 (purple). You can use the -sprites and -colours options to check out how these colours have been defined and look, and the distinct resource to limit the distinct colours used. The colour resources use the 'mris' or 'msit' widget instance
within the widget tree. They have the optional sub resource 'swap'. The
following are valid.
The usual toolkit parsing rules apply to these resources. Namely that '*' is used to fill out levels of hierarchy, while '.' is used for explicit matching. The toolkit uses the longest matching string to select resources in the case of ambiguities. Ie, 'Xmris*Swap.Background' will be selected over 'Xmris*Background' for the swapped versions. The defaults for 'mris', 'mris.swap', 'msit' and 'msit.swap' are
included after the resource class.
GARDENSYou may override the default garden layouts by specifying a garden
file. The file is a text file consisting a of a set of garden definitions,
include files, or comments. An include file is specified by '#include
"filename"', where filename is the name of the included
file. Relative include files are searched for relative to the including
file, or, if that fails, in the Mr Is subdirectory of app-defaults directory
(this will usually be '/usr/lib/X11/app-defaults/xmris'). In If the filename
is null, then the internal gardens will be included. Comments are delimited
by '/*' and '*/', A garden definition is the following format,
'{fillpattern, backgroundcolour, apples,
{layout}},'. New gardens must begin on a new line. Fillpattern
is an integer specifying one of the following fill patterns,
Backgroundcolour is an integer specifying one of the
following background colour schemes,
Apples specifies the number of apples to place in the
garden. Its upper limit is twelve. Layout consists of 13 strings of
12 characters each, such as '"..b@@B..@@.B"'. Within these strings
the following characters are used,
The path characters specify connections to the cell below and to the right. A bit mask is obtained by subtracting the base character. Bit 0 connects downwards and bit 2 connects to the right. The explicit apple positions define four sets of apple locations, using the four bits obtained by subtracting the base character. Random apples will be placed on any cell which is not a pathway, cherry or invalid apple location. There must be at least one cherry, at least one den and exactly one player. Certain locations must be pathway. The garden is checked, and if faulty, it will be fixed, if possible. The format of these garden files is similar to a C source file, except that includes and comments can only occur between garden definitions, and missing or superfluous commas are ignored. You can examine the gardens during the demonstration screens. When a garden is shown, the direction keys can be used to change the garden number. Up and down increment and decrement by ten, whilst right and left increment and decrement by one. If a game is started from the selected garden, then it will be the initial garden, but you won't score any points. ENVIRONMENTA few environment variables are used to locate resources.
FILESThe loadable garden file must be fully named, or located in the
score directory. They may have any name. The score files have the following
names.
SEE ALSOxmred(6) ERRORSIf you use a lock file, rather than lockf, and an error occurs creating the lock file, a message is printed on stderr, and file locking is not done for that access. Subsequent accesses may be alright. If an error occurs opening the score file, a message is printed on stderr, and the score file is disabled. Personal score files will be generated in the users' home directories. Various errors can occur during initialization, most are obvious. Note that if you requested a non-default visual, you may also have to request a private colormap, otherwise an X error 8 on request 1:0 occurs when realizing the widget. Some systems' timer returns too soon. Mr Is detects this, and then starts performing a busywait at the end of the timer period. A warning is also printed. If this is the case, it may be better to force busywaiting with the busywait resource. If a loadable garden is incorrect, an error is displayed, enabling you to locate the offending files and lines. The garden is ignored. BUGSMr Is can be addictive, so don't blame me if your work suffers. Mr Is does not check that the key definitions in the application resources do not conflict with each other. Neither are the colours checked, to see that things are actually visible. Some of the -msit -swap sprites have black pixels at their edge. These should really be background colour pixels, but this is only significant if the -swap background colour is not dark. Best of the day scores scored between 21:00 Dec 31 and 00:00 Jan 1 won't be kept until noon on New Year's Day. One of the sprites with lettering, has the lettering reversed when facing left. Getting accurate, stable timing is difficult, as Unix is not a real time OS. Unix schedules processes in ticks, with a certain granularity. Getting finer grained timing than that is very much system dependent. There is also slippage between receiving one interrupt and starting the next one. You don't want to get the interrupt to restart itself (even though this is possible), as you then get very rude behaviour if your main loop is a bit too slow, (Mr Is on speed). Some timers round downwards, returning before the requested time. This has to be detected, and a busy wait inserted. The visual class name conversion is performed by a standard toolkit routine. It accepts only American spelling, the English spelling of grey and colour are not allowed. COPYRIGHTCopyright (C) 1995, 1994, 1993, 1992 Nathan Sidwell. AUTHORNathan Sidwell <nathan@pact.srf.ac.uk> <http://www.pact.srf.ac.uk/~nathan/> Additional sprites by Stefan Gustavson <stefang@isy.liu.se>
|