]> git.lizzy.rs Git - nothing.git/blob - README.md
Add TODO(#862)
[nothing.git] / README.md
1 [![Build Status](https://travis-ci.org/tsoding/nothing.svg?branch=master)](https://travis-ci.org/tsoding/nothing)
2 [![Build status](https://ci.appveyor.com/api/projects/status/gxfgojq4ko98e0g0/branch/master?svg=true)](https://ci.appveyor.com/project/rexim/nothing/branch/master)
3
4 # Nothing
5
6 ![](https://i.imgur.com/7mECYKU.gif)
7 ![](https://i.imgur.com/ABcJqB5.gif)
8
9 ## Dependencies
10
11 - [gcc]
12 - [cmake]
13 - [libsdl2-dev]
14 - [inotify-tools]
15
16 ### Ubuntu
17
18 ```console
19 $ sudo apt-get install gcc cmake libsdl2-dev inotify-tools libxml2-dev
20 ```
21
22 ### MacOS
23
24 ```console
25 $ brew install gcc cmake sdl2
26 ```
27
28 ### NixOS
29
30 For [NixOS] we have a development environment defined in [default.nix]
31 with all of the required dependencies. You can enter the environment
32 with `nix-shell` command:
33
34 ```console
35 $ nix-shell
36 ```
37
38 ### Arch Linux
39
40 ```console
41 $ sudo pacman -S gcc cmake sdl2 inotify-tools libxml2
42 ```
43
44 ### Windows
45
46 See [Build on Windows][build-on-windows] section.
47
48 ## Quick Start
49
50 ```console
51 $ mkdir build
52 $ cd build/
53 $ cmake ..
54 $ make
55 $ ./nothing ../levels/
56 $ ./nothing_test
57 ```
58
59 ## Controls
60
61 ### Game
62
63 #### Keyboard
64
65 | Key     | Action                                                      |
66 |---------|-------------------------------------------------------------|
67 | `d`     | Move to the right                                           |
68 | `a`     | Move to the left                                            |
69 | `SPACE` | Jump                                                        |
70 | `c`     | Open debug console                                          |
71 | `r`     | Reload the current level including the Player's position    |
72 | `q`     | Reload the current level preserving the Player's position   |
73 | `p`     | Toggle game pause                                           |
74 | `l`     | Toggle transparency on objects. Useful for debugging levels |
75
76 #### Gamepad
77
78 | Button       | Action                 |
79 |--------------|------------------------|
80 | `Left Stick` | Movement of the Player |
81 | `1`          | Jump                   |
82
83 ### ConsolĂ©
84
85 | Key       | Action                   |
86 |-----------|--------------------------|
87 | `ESC`     | Exit console             |
88 | `Enter`   | Evaluate the expression  |
89 | `Up/Down` | Traverse console history |
90
91 ## Editing Levels
92
93 Generally creating a level looks like:
94
95 ```
96 SVG File -> Custom Level File -> Game
97 ```
98
99 To convert SVG to the level file and run svg2level program:
100
101 ```console
102 $ ./build/svg2level compile <svg-file> <level-file>
103 ```
104
105 All of the levels reside in the [./levels/] folder. Use
106 [./levels/Makefile] to automatically rebuild all levels:
107
108 ```console
109 $ cd levels/     # you must be inside of the `levels/` folder
110 $ make
111 ```
112
113 ### Level Editing Workflow
114
115 1. `$ inkscape ./levels/level.svg &`
116 2. `$ ./build/nothing ./levels/level.txt &`
117 3. `$ cd ./levels/`
118 4. `$ make watch`
119 5. Edit Level in Inkscape and Save
120 6. Switch to the Game and reload level by pressing Q
121 7. Go to 5
122
123 ### Objects Reference
124
125 #### SVG rect node
126
127 | Regex of id  | Description                                                                                                       |
128 |--------------|-------------------------------------------------------------------------------------------------------------------|
129 | `player`     | Defines the **position** of the Player. **Size is ignored**.                                                      |
130 | `rect.*`     | Defines the **size** and **position** of an impenetrable platform block                                           |
131 | `box.*`      | Defines the **size** and **position** of a rigid box that obeys the physics of the game                           |
132 | `region(.*)` | Defines the **size** and **position** of a region that hides the Goals. `\1` defines the id of the Goal to hide.  |
133 | `goal(.*)`   | Defines the **position** of the goal. **Size is ignored**. `\1` defines the id of the region that hides the goal. |
134 | `lava.*`     | Defines the **position** and **size** of a lava block.                                                            |
135 | `background` | Defines the **color** of the background. **Position and size are ignored**.                                       |
136 | `backrect.*` | Defines the **size** and **position** of a solid block in the background.                                         |
137
138 #### SVG text node
139
140 | Regex of id | Description                                                                |
141 |-------------|----------------------------------------------------------------------------|
142 | `label.*`   | Defines **position** and **text** of a in-game label. **Size is ignored**. |
143
144 ## Build on Windows
145
146 TBD
147
148 <!-- TODO(#862): Windows build is not documented -->
149
150 ## Support
151
152 You can support my work via
153
154 - Twitch channel: https://www.twitch.tv/subs/tsoding
155 - Patreon: https://www.patreon.com/tsoding
156
157 [visual-studio]: https://www.visualstudio.com/
158 [svg2rects.py]: ./devtools/svg2rects.py
159 [./levels/]: ./levels/
160 [./levels/Makefile]: ./levels/Makefile
161 [gcc]: https://gcc.gnu.org/
162 [cmake]: https://cmake.org/
163 [libsdl2-dev]: https://www.libsdl.org/
164 [NixOS]: https://nixos.org/
165 [default.nix]: ./default.nix
166 [build-on-windows]: #build-on-windows
167 [inotify-tools]: https://github.com/rvoicilas/inotify-tools