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)
19 $ sudo apt-get install gcc cmake libsdl2-dev libsdl2-mixer-dev inotify-tools
25 $ brew install gcc cmake sdl2 sdl2_mixer
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:
41 $ sudo pacman -S gcc cmake sdl2 sdl2_mixer inotify-tools
46 See [Build on Windows][build-on-windows] section.
55 $ ./nothing ../levels/level-01.txt
66 |---------|-------------------------------------------------------------|
67 | `d` | Move to the right |
68 | `a` | Move to the left |
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 |
79 |--------------|------------------------|
80 | `Left Stick` | Movement of the Player |
86 |-----------|--------------------------|
87 | `ESC` | Exit console |
88 | `Enter` | Evaluate the expression |
89 | `Up/Down` | Traverse console history |
93 Generally creating a level looks like:
96 SVG File -> Custom Level File -> Game
99 To convert SVG to the level file and run svg2level program:
102 $ ./build/svg2level compile <svg-file> <level-file>
105 All of the levels reside in the [./levels/] folder. Use
106 [./levels/Makefile] to automatically rebuild all levels.
108 ### Level Editing Workflow
110 1. `$ inkscape ./levels/level.svg &`
111 2. `$ ./build/nothing ./levels/level.txt &`
114 5. Edit Level in Inkscape and Save
115 6. Switch to the Game and reload level by pressing Q
118 ### Objects Reference
122 | Regex of id | Description |
123 |--------------|-------------------------------------------------------------------------------------------------------------------|
124 | `player` | Defines the **position** of the Player. **Size is ignored**. |
125 | `rect.*` | Defines the **size** and **position** of an impenetrable platform block |
126 | `box.*` | Defines the **size** and **position** of a rigid box that obeys the physics of the game |
127 | `region(.*)` | Defines the **size** and **position** of a region that hides the Goals. `\1` defines the id of the Goal to hide. |
128 | `goal(.*)` | Defines the **position** of the goal. **Size is ignored**. `\1` defines the id of the region that hides the goal. |
129 | `lava.*` | Defines the **position** and **size** of a lava block. |
130 | `background` | Defines the **color** of the background. **Position and size are ignored**. |
131 | `backrect.*` | Defines the **size** and **position** of a solid block in the background. |
135 | Regex of id | Description |
136 |-------------|----------------------------------------------------------------------------|
137 | `label.*` | Defines **position** and **text** of a in-game label. **Size is ignored**. |
141 You need to install [conan][] and [Visual Studio 2017][visual-studio].
145 Current version of [SDL2/2.0.5@lasote/stable][conan-sdl2] in the conan-transit
146 repository is not compatible with the latest conan, so you'll need to install
147 it locally from the git repository:
150 $ git clone https://github.com/lasote/conan-sdl2.git # temporary, I hope hope hope
152 $ conan export SDL2/2.0.5@lasote/stable
157 Execute the following commands inside of the `nothing` directory:
160 $ conan install --build missing --install-folder build
162 $ cmake .. -G "Visual Studio 15 2017 Win64"
165 After that, build the `build/nothing.sln` file with Visual Studio.
169 You can support my work via
171 - Twitch channel: https://www.twitch.tv/subs/tsoding
172 - Patreon: https://www.patreon.com/tsoding
174 [conan]: https://www.conan.io/
175 [conan-sdl2]: https://bintray.com/conan/conan-transit/SDL2%3Alasote/2.0.5%3Astable
176 [visual-studio]: https://www.visualstudio.com/
177 [svg2rects.py]: ./devtools/svg2rects.py
178 [./levels/]: ./levels/
179 [./levels/Makefile]: ./levels/Makefile
180 [gcc]: https://gcc.gnu.org/
181 [cmake]: https://cmake.org/
182 [libsdl2-dev]: https://www.libsdl.org/
183 [libsdl2-mixer-dev]: https://www.libsdl.org/projects/SDL_mixer/
184 [NixOS]: https://nixos.org/
185 [default.nix]: ./default.nix
186 [build-on-windows]: #build-on-windows
187 [inotify-tools]: https://github.com/rvoicilas/inotify-tools