.TH THRICKEN 6 "9th April 1992"
.SH NAME
thricken \- a multiscreen collect-the-objects style game
.SH SYNOPSIS
.I thricken
[-l level_num ] [ -d directory ]
.SH DESCRIPTION
.I thricken
is designed to be a flexible game whereby the actual game strategies may vary
substantially from level to level. Each level can have it's own set of
sprites, it's own map, and it's own list of interactions between the sprites.
Although the basic aim of each level is always the same - to collect all the
'collectable' items (such as diamonds or bearings). The current item to
collect is displayed in the panel on the right hand side of the screen. Also
in this window is the current number of items needed to collect before the
level is finished, the current score, the current number of moves, and the
current level number.
.sp
You may start on any level you wish by using the
.I -l level_num
option. If you attempt to start on a non existant level you will be told it
does not exist. This also happens when you finish the last level as there is
currently no 'end game' sequence. If you do not give the level number as an
option then the game should automatically place you on the highest level you
have reached so far. Note that you cannot (well, shouldn't) be able to fool
the game into thinking you've completed the first 5 levels by starting on
level 5. Level 0 is the first level.
.sp
The keys are defined as follows :
.ta 1i 2i
.br
	h	left
.br
	j	down
.br
	k	up
.br
	l	right
.br
	q	quit
.br
	s	save (to memory)
.br
	r 	restore (from memory)
.sp
Should you wish to give the game a different feel when using a different set
of sprites and rules you may specify a directory as an argument using the
.I -d directory
option. This allows for the same program to utilise a different score (more
really like a 'position') file, a different logo, and to some extent a
different panel style. This is also a very useful feature should you wish to
design and play your own set of screens.
.sp
To design your own screens for the game is relatively simple. In you \fBlib\fP
directory you *must* have files called \fIscreen\fP and \fIscore\fP. Any
levels you write should be saved as the level number (two digits) followed by
'level'. For instance, \fB00level\fP and \fB99level\fP. Each level file in
turn will reference a sprite file and a collisions file. These filenames are
specified by the user.
.sp
The format of a level file is as follows:
.ta 1i
.nf
line 1	: sprite filename
line 2	: collisions filename
line 3	: map height
line 4	: map width
line 5	: start x coord (top left of map is 0 0)
line 6	: start y coord
line 7	: no. of diamonds (collectables) needed to finish the level
then	: map data (`height` lines)
end-2	: name of diamonds (collectables)
end-1	: name of screen
end	: author of level
.fi
.sp
The map data itself is just a matrix of ASCII characters. A few characters are
reserved and there meaning should not be changed.
.br
\fId\fP is always a diamond, and is the only collectable sprite
.br
\fI<space>\fP is always a background (walkable) sprite.
.br
\fI<\fP, \fIv\fP, \fI^\fP, \fI>\fP are the sprites for you facing left, down,
up and right respectively.
.sp
The sprite data format is simpler to understand. It consists of a list of
sprite characters and data. Each character used on the map (such as 'you')
needs to be defined in this file. Each sprite entry consists of one line for
the sprite character to be used on the map, and three lines (of six characters
long each) for what the sprite will look like on the screen. Care must be
taken to ensure that the sprites are six characters wide. For instance, five
wide sprites need to be padded with a space. A snippet from an example sprite
file (defining only you) is shown here:
.sp
.nf
>
 /O__o
 \e\___/
 /_\e\_ 
<
o__O\e\ 
\e\___/ 
 _/_\e\ 
^
 ^__^ 
/----\e\ 
_/  \e\_
v
 O__O 
/----\e\ 
_/  \e\_
.fi
.sp
The collisions file defines what happens to a sprite when you push it into
another. Upon moving the game remembers the sprite directly in front of you,
and the sprite behind that one (which can be considered as the sprite that you
are trying to push the sprite directly next to you on to). To define a
collision between two sprites we specify the two sprites colliding, the two
resultant sprites, the direction we were moving in, and the change in score.
.sp
The first line of the file contains a list of sprites which can be walked
over, or which other sprites may be pushed over (unless a collision is defined
contrary to this). This could simply be a single space on a line. The second
line is a list of pushable sprites - such as boulders and keys. The third
onwards lines define a single collision per line in the following format.
.sp
.nf
char 1	: sprite nearest to player before collision
char 2	: sprite furthest from player before collision
char 3	: sprite nearest to player after collision
char 4	: sprite furthest from player after collision
char 5-8	: directions for which collision is valid
chars 9-	: decimal number for change in score
.fi
.sp
A short note about the directions field (char 5-8) : There must be four
characters here. Each of the four characters corresponds to each of the four
directions the player can walk in. Treat the four characters as a string. If
the direction is in the string then the collision is valid. Otherwise the
string must be padded with spaces upto the four character limit. For example:
.sp
\fIooddhjkl10\fP will turn two 'o's into two 'd's (the collectables) upon any
of the four directions, scoring 10 points.
.br
\fIhH  h   15\fP - when pusing an 'h' (eg a left key) into an 'H' (eg a left
door) from direction 'h' (left) replace both sprites with a blank (space) and
score 15 points.
.sp
Upon a collision, if the resulting sprite directly in front of the player is a
walkable sprite (or the collectable) the player is also moved forward one
square in addition to the collision being performed.
.sp
A few sprite names have special meaning in collisions (and so should not be
used on the map). They are wildcards for any sprite obeying the following
rules.
.br
x = any non walkable sprite.
.br
X = any non pushable sprite.
.br
* = any sprite.
.sp
Hence '\fIGXdh  l-5\fP' would be a sprite G which can turn any pushable sprite
into a diamond (scoring -5 points), but only on directions left and right.
.SH FILES
.ta 2i
.br
.I LIBDIR/xxlevel	- The level files (00level to 99level)
.br
.I LIBDIR/scores	- The 'score' table
.br
.I LIBDIR/screen	- The initial screen and panel layout
.br
where LIBDIR is usually /usr/games/lib/thricken.
.SH AUTHOR
.I thricken
was written by James 'Rince' Bonfield. He can be contacted via email at
'rince@dcs.warwick.ac.uk' (currently - not sure how long this shall last).
.SH BUGS
No checks for relative pathnames are done within the level files. This means
that there may be potential security problems if the game is installed setuid
or setgid. I would not recommend it.
.sp
The score table is not really a score table. It can be examined using the
\fI-s\fP option, but this is not a wise thing to take note of. It is a classic
example of something started and never finished. The current state of the
score table is simply to keep a record of whom has played up to which level
(and not 100% bug free in that bit either). The rank of a player is not
computed. 
.sp
The game concepts and ideas have already been junked in preference for a
better method. This was one reason for so little time being devoted to this
game. I would like to see any new screens anyone produces, but I am not likely
to fix any bugs as I view it as a terminated project. Feel free to fix them
yourselves :-)
Thricken Version 1.1

This is the game of thricken - written by James 'Rince' Bonfield.
You may redistribute and modify any of this source provided that my name is
still mentioned in connection with the pieces of code I have written.

I'd be interested in any screens you happen to write for the game - as can be
seen by my (and Radagast aka Stephen Landmore) exploits the screens can be
pretty flexible and unlike each other.

Email me at :
	rince@dcs.warwick.ac.uk


What this doesn't do :
	No decent high score system
	Currently it pretends to save what level you last got up to, but is
		somewhat buggy still in this area.
	Do project work for you.

