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