]> git.lizzy.rs Git - nothing.git/blob - README.md
Merge pull request #439 from tsoding/433
[nothing.git] / README.md
1 [![Build Status](https://travis-ci.org/tsoding/nothing.svg?branch=master)](https://travis-ci.org/tsoding/nothing)
2
3 # Nothing
4
5 ![](https://i.imgur.com/7mECYKU.gif)
6 ![](https://i.imgur.com/ABcJqB5.gif)
7
8 ## Quick Start
9
10 ```console
11 $ nix-shell              # Only on NixOS
12 $ mkdir build
13 $ cd build/
14 $ cmake ..
15 $ make
16 $ ./nothing ../levels/level-01.txt
17 $ ./nothing_test
18 ```
19
20 ## Controls
21
22 ### Game
23
24 | Key | Action             |
25 |-----|--------------------|
26 | `d` | Move to the right  |
27 | `a` | Move to the left   |
28 | `c` | Open debug console |
29
30 ### Console
31
32 | Key   | Action       |
33 |-------|--------------|
34 | `ESC` | Exit console |
35
36 ## Editing Levels
37
38 Generally creating a level looks like:
39
40 ```
41 SVG File -> Custom Level File -> Game
42 ```
43
44 To convert SVG to the level file install [xqilla] and run
45 [svg2rects.xqe] script:
46
47 ```console
48 $ xqilla ./devtools/svg2rects.xqe -i <svg-file> -o <level-file>
49 ```
50
51 All of the levels reside in the [./levels/] folder. Use
52 [./levels/Makefile] to automatically rebuild all levels.
53
54 ### Level Editing Workflow
55
56 1. `$ inkscape ./levels/level.svg &`
57 2. `$ ./build/nothing ./levels/level.txt &`
58 3. `$ cd ./levels/`
59 4. `$ make watch`
60 5. Edit Level in Inkscape and Save
61 6. Switch to the Game and reload level by pressing Q
62 7. Go to 5
63
64 ### Objects Reference
65
66 #### SVG rect node
67
68 | Regex of id  | Description                                                                                                       |
69 |--------------|-------------------------------------------------------------------------------------------------------------------|
70 | `player`     | Defines the **position** of the Player. **Size is ignored**.                                                      |
71 | `rect.*`     | Defines the **size** and **position** of an impenetrable platform block                                           |
72 | `box.*`      | Defines the **size** and **position** of a rigid box that obeys the physics of the game                           |
73 | `region(.*)` | Defines the **size** and **position** of a region that hides the Goals. `\1` defines the id of the Goal to hide.  |
74 | `goal(.*)`   | Defines the **position** of the goal. **Size is ignored**. `\1` defines the id of the region that hides the goal. |
75 | `lava.*`     | Defines the **position** and **size** of a lava block.                                                            |
76 | `background` | Defines the **color** of the background. **Position and size are ignored**.                                       |
77 | `backrect.*` | Defines the **size** and **position** of a solid block in the background.                                         |
78
79 #### SVG text node
80
81 | Regex of id | Description                                                                |
82 |-------------|----------------------------------------------------------------------------|
83 | `label.*`   | Defines **position** and **text** of a in-game label. **Size is ignored**. |
84
85 ## Build on Windows
86
87 You need to install [conan][] and [Visual Studio 2017][visual-studio].
88
89 ### Dependencies
90
91 Current version of [SDL2/2.0.5@lasote/stable][conan-sdl2] in the conan-transit
92 repository is not compatible with the latest conan, so you'll need to install
93 it locally from the git repository:
94
95 ```console
96 $ git clone https://github.com/lasote/conan-sdl2.git # temporary, I hope hope hope
97 $ cd conan-sdl2
98 $ conan export SDL2/2.0.5@lasote/stable
99 ```
100
101 ### Building
102
103 Execute the following commands inside of the `nothing` directory:
104
105 ```console
106 $ conan install --build missing --install-folder build
107 $ cd build
108 $ cmake .. -G "Visual Studio 15 2017 Win64"
109 ```
110
111 After that, build the `build/nothing.sln` file with Visual Studio.
112
113 ## Support
114
115 You can support my work via
116
117 - Twitch channel: https://www.twitch.tv/subs/tsoding
118 - Patreon: https://www.patreon.com/tsoding
119
120 [conan]: https://www.conan.io/
121 [conan-sdl2]: https://bintray.com/conan/conan-transit/SDL2%3Alasote/2.0.5%3Astable
122 [visual-studio]: https://www.visualstudio.com/
123 [xqilla]: http://xqilla.sourceforge.net/HomePage
124 [svg2rects.xqe]: ./devtools/svg2rects.xqe
125 [./levels/]: ./levels/
126 [./levels/Makefile]: ./levels/Makefile