aboutsummaryrefslogtreecommitdiff
path: root/src/docs/user.md
blob: 77bbf35cda66df15a401be3ab78433f86294a70c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
title: "BSc IN S5 / OOP with Java / Wall-J / User manual"
author: [Pacien TRAN-GIRARD, Adam NAILI]
date: 2018-01-03
...

# Preamble

"Wall-J: the Space Cleaner" is a game in which a player uses bombs to push garbage into trash cans in user definable
worlds.

Being part of the "OOP with Java" course at [UPEM](http://www.u-pem.fr/), this application has been entirely
written in Java and makes use of the Zen5 and [JBox2D](http://www.jbox2d.org/) libraries.

## Licensing

This work is licensed under the terms of the
[Creative Commons BY-NC-SA 4.0 license](https://creativecommons.org/licenses/by-nc-sa/4.0/) by its authors:
Pacien TRAN-GIRARD and Adam NAILI.

Build-time and embedded run-time dependencies of this program are licensed under their own respective terms.

---

# Usage

## Prerequisites

This application requires the Java Runtime Environment version $\geq$ 8.

A graphical session is also needed to display the game window.

## Running the program

The program can be started by running the following command:

    java -jar wallj.jar

A custom world set contained within a directory can be loaded by supplying its path as command line argument as such:

    java -jar wallj.jar /home/sforthright/bnl/axiom_floors/

World definition files stored within the given directories and named as `level$i.txt`, where `$i` is a padded integer,
are loaded in alphanumerical order.

\newpage

# Game-play

## Rules

The player controls a robot, dropping bombs whose explosion can push garbage into trash cans.

Garbage bounce when colliding other elements such as walls, unexploded bombs or other garbage blocks,
and disappear of the screen when reaching a garbage can.

A stage is considered done once the world has been cleared of all its garbage.
The player is then allowed to move on to the next stage.
The game is finished once all stages are completed.

## World

The world is rectangular grid composed of the following type of tiles:

Entity type Appearance   Pushable by bomb Traversable by robot
----------- ------------ ---------------- --------------------
Wall        Black square No               No
Trash can   Red square   No               No
Free        Empty        No               Yes
Bomb        Black disk   No               Yes
Garbage     Brown disk   Yes              Yes
Robot       Blue disk    /                /

## Controls

Controls are defined as follows:

Trigger                         Action
------------------------------- -------------------------------------------------------
Click on a traversable tile     Moves the robot to the pointed location
`RETURN` on a free tile         Drops a bomb at the current location
`RETURN` on a tile with a bomb  Increases the timer of the bomb at the current location

\newpage

## Custom levels

Custom world can be defined by the user in plain text files, each of which containing a single world.
Such a definition file most contain no empty line, leading or trailing tabulation or space.

A tile map is a rectangular character array from the following alphabet:

Block type  Character Bounding Must be reachable
----------  --------- -------- -----------------
Free        (space)   No       Yes
Garbage     G         No       Yes
Trash can   T         Yes      Yes
Wall        W         Yes      No

A world is defined as valid if its blocks fulfill the following criteria:

* The bounding box of the defined world must be made of bounding blocks.
* The interior space formed by bounding blocks must be unique and simple.
* Reachable blocks are either be adjacent or belong to the interior space.
* The world must contain at least one trash can and one garbage block.

Only valid worlds can be loaded into the game.

The validity of a world may not guaranty the solvability of the puzzle.

\newpage

__Example of invalid world definition:__
```
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
W                              W                               W
W                              W                               W    T
                      WWWWWWWWWW                               W
                      W        W                               W
                      W        W                               WWWWWWWWWWW
                      WWWWWWWWWW                                         W
W                              W                                         W
W                              W                                         W
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
```

__Example of valid world definition:__
```
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
W                                                              WWWWWWWWWWW
W                                                              WWWWWWWWWWW
T                     WWWWWWWWWW                               WWWWWWWWWWW
T                     WWWWWWWWWW        GGGGGGGGGGGGG          WWWWWWWWWWW
T                     WWWWWWWWWW        GGGGGGGG    G          WWWWWWWWWWW
T                     WWWWWWWWWW        GGGGGGGGGGGGG                    W
W                              W                                         W
W                              W                                         W
WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
```