1 [![Build Status](https://travis-ci.org/tsoding/nothing.svg?branch=master)](https://travis-ci.org/tsoding/nothing)
5 ![](https://i.imgur.com/7mECYKU.gif)
6 ![](https://i.imgur.com/ABcJqB5.gif)
20 $ sudo apt-get install gcc cmake libsdl2-dev libsdl2-mixer-dev python3 inotify-tools
26 $ brew install gcc cmake sdl2 sdl2_mixer python3
31 For [NixOS] we have a development environment defined in [default.nix]
32 with all of the required dependencies. You can enter the environment
33 with `nix-shell` command:
42 $ sudo pacman -S gcc cmake sdl2 sdl2_mixer python inotify-tools
47 See [Build on Windows][build-on-windows] section.
56 $ ./nothing ../levels/level-01.txt
67 |---------|-------------------------------------------------------------|
68 | `d` | Move to the right |
69 | `a` | Move to the left |
71 | `c` | Open debug console |
72 | `r` | Reload the current level including the Player's position |
73 | `q` | Reload the current level preserving the Player's position |
74 | `p` | Toggle game pause |
75 | `l` | Toggle transparency on objects. Useful for debugging levels |
80 |--------------|------------------------|
81 | `Left Stick` | Movement of the Player |
87 |-----------|--------------------------|
88 | `ESC` | Exit console |
89 | `Enter` | Evaluate the expression |
90 | `Up/Down` | Traverse console history |
94 Generally creating a level looks like:
97 SVG File -> Custom Level File -> Game
100 To convert SVG to the level file and run [svg2rects.py] script:
103 $ python3 ./devtools/svg2rects.py -i <svg-file> -o <level-file>
106 All of the levels reside in the [./levels/] folder. Use
107 [./levels/Makefile] to automatically rebuild all levels.
109 ### Level Editing Workflow
111 1. `$ inkscape ./levels/level.svg &`
112 2. `$ ./build/nothing ./levels/level.txt &`
115 5. Edit Level in Inkscape and Save
116 6. Switch to the Game and reload level by pressing Q
119 ### Objects Reference
123 | Regex of id | Description |
124 |--------------|-------------------------------------------------------------------------------------------------------------------|
125 | `player` | Defines the **position** of the Player. **Size is ignored**. |
126 | `rect.*` | Defines the **size** and **position** of an impenetrable platform block |
127 | `box.*` | Defines the **size** and **position** of a rigid box that obeys the physics of the game |
128 | `region(.*)` | Defines the **size** and **position** of a region that hides the Goals. `\1` defines the id of the Goal to hide. |
129 | `goal(.*)` | Defines the **position** of the goal. **Size is ignored**. `\1` defines the id of the region that hides the goal. |
130 | `lava.*` | Defines the **position** and **size** of a lava block. |
131 | `background` | Defines the **color** of the background. **Position and size are ignored**. |
132 | `backrect.*` | Defines the **size** and **position** of a solid block in the background. |
136 | Regex of id | Description |
137 |-------------|----------------------------------------------------------------------------|
138 | `label.*` | Defines **position** and **text** of a in-game label. **Size is ignored**. |
142 You need to install [conan][] and [Visual Studio 2017][visual-studio].
146 Current version of [SDL2/2.0.5@lasote/stable][conan-sdl2] in the conan-transit
147 repository is not compatible with the latest conan, so you'll need to install
148 it locally from the git repository:
151 $ git clone https://github.com/lasote/conan-sdl2.git # temporary, I hope hope hope
153 $ conan export SDL2/2.0.5@lasote/stable
158 Execute the following commands inside of the `nothing` directory:
161 $ conan install --build missing --install-folder build
163 $ cmake .. -G "Visual Studio 15 2017 Win64"
166 After that, build the `build/nothing.sln` file with Visual Studio.
170 You can support my work via
172 - Twitch channel: https://www.twitch.tv/subs/tsoding
173 - Patreon: https://www.patreon.com/tsoding
175 [conan]: https://www.conan.io/
176 [conan-sdl2]: https://bintray.com/conan/conan-transit/SDL2%3Alasote/2.0.5%3Astable
177 [visual-studio]: https://www.visualstudio.com/
178 [svg2rects.py]: ./devtools/svg2rects.py
179 [./levels/]: ./levels/
180 [./levels/Makefile]: ./levels/Makefile
181 [gcc]: https://gcc.gnu.org/
182 [cmake]: https://cmake.org/
183 [libsdl2-dev]: https://www.libsdl.org/
184 [libsdl2-mixer-dev]: https://www.libsdl.org/projects/SDL_mixer/
185 [python3]: https://www.python.org/
186 [NixOS]: https://nixos.org/
187 [default.nix]: ./default.nix
188 [build-on-windows]: #build-on-windows
189 [inotify-tools]: https://github.com/rvoicilas/inotify-tools