]> git.lizzy.rs Git - nothing.git/blob - README.md
Merge pull request #1255 from tsoding/1253
[nothing.git] / README.md
1 [![Tsoding](https://img.shields.io/badge/twitch.tv-tsoding-purple?logo=twitch&style=for-the-badge)](https://www.twitch.tv/tsoding)
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 [![Build Status](https://github.com/tsoding/nothing/workflows/CI/badge.svg)](https://github.com/tsoding/nothing/actions)
4
5 # Nothing
6
7 ![](https://i.imgur.com/7mECYKU.gif)
8 ![](https://i.imgur.com/ABcJqB5.gif)
9
10 ## Dependencies
11
12 - [gcc] or [clang] or [MSVC 2015+][visual-studio]
13 - [cmake]
14 - [libsdl2-dev]
15
16 ### Ubuntu
17
18 ```console
19 $ sudo apt-get install gcc cmake libsdl2-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
42 ```
43
44 ### Windows
45
46 #### Visual Studio
47
48 - [Visual Studio 2015+](https://visualstudio.microsoft.com/)
49 - [SDL2 VC Development Libraries](https://www.libsdl.org/release/SDL2-devel-2.0.9-VC.zip)
50
51 #### MinGW
52 - [mingw-w64](https://mingw-w64.org)
53 - [SDL2 MinGW Development Libraries](https://www.libsdl.org/release/SDL2-devel-2.0.10-mingw.tar.gz)
54
55 ## Quick Start
56
57 ### Linux
58
59 #### CMake
60
61 ```console
62 $ mkdir build
63 $ cd build/
64 $ cmake ..
65 $ make
66 $ ./nothing
67 ```
68
69 #### SCU
70
71 ```console
72 $ ./build-posix.sh
73 $ ./nothing
74 ```
75
76 ### Windows
77
78 #### Visual Studio
79
80 - Enter the Visual Studio Command Line Development Environment https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line
81   - Basically just find `vcvarsall.bat` and run `vcvarsall.bat x64` inside of cmd
82 - Download [SDL2 VC Development Libraries](https://www.libsdl.org/release/SDL2-devel-2.0.9-VC.zip) and copy it to `path\to\nothing`
83
84 ```console
85 > cd path\to\nothing
86 > 7z x SDL2-devel-2.0.9-VC.zip
87 > move SDL2-2.0.9 SDL2
88 > mkdir build
89 > cd build
90 > cmake ..
91 > cmake --build .
92 > .\nothing
93 ```
94
95 #### MinGW (with MSYS)
96
97 ```console
98 $ cd path/to/nothing
99 $ wget https://www.libsdl.org/release/SDL2-devel-2.0.10-mingw.tar.gz
100 $ tar xzf SDL2-devel-2.0.10-mingw.tar.gz
101 $ mv SDL2-2.0.10 SDL2
102 $ rm SDL2-devel-2.0.10-mingw.tar.gz
103 $ mkdir build && cd build
104 $ cmake .. -G "MSYS Makefiles"
105 $ cmake --build .
106 $ ./nothing
107 ```
108
109 #### MinGW (without MSYS)
110 - Download [SDL2 MinGW Development Libraries](https://www.libsdl.org/release/SDL2-devel-2.0.10-mingw.tar.gz) and copy it to `path\to\nothing`
111
112 ```console
113 > cd path\to\nothing
114 > 7z x SDL2-devel-2.0.10-mingw.tar.gz -so | 7z x -si -ttar
115 > move SDL2-2.0.10 SDL2
116 > del SDL2-devel-2.0.10-mingw.tar.gz
117 > mkdir build
118 > cd build
119 > cmake .. -G "MinGW Makefiles"
120 > cmake --build .
121 > .\nothing
122 ```
123
124 ## Controls
125
126 ### Game
127
128 #### Keyboard
129
130 | Key       | Action                                                      |
131 |---------- |-------------------------------------------------------------|
132 | `d`       | Move to the right                                           |
133 | `a`       | Move to the left                                            |
134 | `w/SPACE` | Jump                                                        |
135 | `c`       | Open debug console                                          |
136 | `r`       | Reload the current level including the Player's position    |
137 | `q`       | Reload the current level preserving the Player's position   |
138 | `p`       | Toggle game pause                                           |
139 | `l`       | Toggle transparency on objects. Useful for debugging levels |
140 | `TAB`     | Switch to Level Editor                                      |
141 | `CTRL+q`  | Quit the game                                               |
142
143 #### Gamepad
144
145 | Button       | Action                 |
146 |--------------|------------------------|
147 | `Left Stick` | Movement of the Player |
148 | `1`          | Jump                   |
149
150 ### ConsolĂ©
151
152 | Key                 | Action                   |
153 |---------------------|--------------------------|
154 | `ESC`               | Exit console             |
155 | `Enter`             | Evaluate the expression  |
156 | `Up/Down`           | Traverse console history |
157 | `CTRL+L`            | Clear                    |
158 | `Ctrl+X`, `CTRL+W`  | Cut                      |
159 | `Ctrl+C`, `ALT+W`   | Copy                     |
160 | `Ctrl+V`, `CTRL+Y`  | Paste                    |
161
162 ### Level Editor
163
164 To access the Level Editor open a level and press `TAB`.
165
166 | Key             | Action                                     |
167 |-----------------|--------------------------------------------|
168 | `s`             | Save level                                 |
169 | `Mouse Wheel`   | Zoom and pan                               |
170 | `CTRL+z`        | Undo                                       |
171 | `q`             | Toggle snapping mode                       |
172 | `SHIFT+Up/Down` | Change overlaping order of selected object |
173 | `CTRL+c/v`      | Copy/paste selected object                 |
174 | `F2`            | Rename selected object                     |
175 | `DELETE`        | Delete selected object                     |
176
177 ## Support
178
179 You can support my work via
180
181 - Twitch channel: https://www.twitch.tv/subs/tsoding
182 - Patreon: https://www.patreon.com/tsoding
183
184 [visual-studio]: https://www.visualstudio.com/
185 [svg2rects.py]: ./devtools/svg2rects.py
186 [./levels/]: ./levels/
187 [./levels/Makefile]: ./levels/Makefile
188 [gcc]: https://gcc.gnu.org/
189 [clang]: https://clang.llvm.org/
190 [cmake]: https://cmake.org/
191 [libsdl2-dev]: https://www.libsdl.org/
192 [NixOS]: https://nixos.org/
193 [default.nix]: ./default.nix
194 [inotify-tools]: https://github.com/rvoicilas/inotify-tools