]> git.lizzy.rs Git - nothing.git/blob - README.md
Merge pull request #1066 from PaprikaX33/arrow-key
[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://travis-ci.org/tsoding/nothing.svg?branch=master)](https://travis-ci.org/tsoding/nothing)
3 [![Build status](https://ci.appveyor.com/api/projects/status/gxfgojq4ko98e0g0/branch/master?svg=true)](https://ci.appveyor.com/project/rexim/nothing/branch/master)
4
5 # Nothing
6
7 ![](https://i.imgur.com/7mECYKU.gif)
8 ![](https://i.imgur.com/ABcJqB5.gif)
9
10 ## Dependencies
11
12 - [gcc]
13 - [cmake]
14 - [libsdl2-dev]
15 - [inotify-tools]
16
17 ### Ubuntu
18
19 ```console
20 $ sudo apt-get install gcc cmake libsdl2-dev inotify-tools libxml2-dev
21 ```
22
23 ### MacOS
24
25 ```console
26 $ brew install gcc cmake sdl2
27 ```
28
29 ### NixOS
30
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:
34
35 ```console
36 $ nix-shell
37 ```
38
39 ### Arch Linux
40
41 ```console
42 $ sudo pacman -S gcc cmake sdl2 inotify-tools libxml2
43 ```
44
45 ### Windows
46
47 #### Visual Studio
48
49 - [Visual Studio 2015+](https://visualstudio.microsoft.com/)
50 - [SDL2 VC Development Libraries](https://www.libsdl.org/release/SDL2-devel-2.0.9-VC.zip)
51
52 #### MinGW
53 - [mingw-w64](https://mingw-w64.org)
54 - [SDL2 MinGW Development Libraries](https://www.libsdl.org/release/SDL2-devel-2.0.10-mingw.tar.gz)
55
56 ## Quick Start
57
58 ### Linux
59
60 ```console
61 $ mkdir build
62 $ cd build/
63 $ cmake ..
64 $ make
65 $ cd ../assets/
66 $ ../build/nothing
67 ```
68
69 ### Windows
70
71 #### Visual Studio
72
73 - Enter the Visual Studio Command Line Development Environment https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line
74   - Basically just find `vcvarsall.bat` and run `vcvarsall.bat x64` inside of cmd
75 - Download [SDL2 VC Development Libraries](https://www.libsdl.org/release/SDL2-devel-2.0.9-VC.zip) and copy it to `path\to\nothing`
76
77 ```console
78 > cd path\to\nothing
79 > 7z x SDL2-devel-2.0.9-VC.zip
80 > move SDL2-2.0.9 SDL2
81 > mkdir build
82 > cd build
83 > cmake ..
84 > cmake --build .
85 > cd ../assets/
86 > ..\build\nothing
87 ```
88
89 #### MinGW (with MSYS)
90
91 ```console
92 $ cd path/to/nothing
93 $ wget https://www.libsdl.org/release/SDL2-devel-2.0.10-mingw.tar.gz
94 $ tar xzf SDL2-devel-2.0.10-mingw.tar.gz
95 $ mv SDL2-2.0.10 SDL2
96 $ rm SDL2-devel-2.0.10-mingw.tar.gz
97 $ mkdir build && cd build
98 $ cmake .. -G "MSYS Makefiles"
99 $ cmake --build .
100 $ cd ../assets/
101 $ ../build/nothing
102 ```
103
104 #### MinGW (without MSYS)
105 - 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`
106
107 ```console
108 > cd path\to\nothing
109 > 7z x SDL2-devel-2.0.10-mingw.tar.gz -so | 7z x -si -ttar
110 > move SDL2-2.0.10 SDL2
111 > del SDL2-devel-2.0.10-mingw.tar.gz
112 > mkdir build
113 > cd build
114 > cmake .. -G "MinGW Makefiles"
115 > cmake --build .
116 > cd ../assets/
117 > ..\build\nothing
118 ```
119
120 ## Controls
121
122 ### Game
123
124 #### Keyboard
125
126 | Key      | Action                                                      |
127 |----------|-------------------------------------------------------------|
128 | `d`      | Move to the right                                           |
129 | `a`      | Move to the left                                            |
130 | `SPACE`  | Jump                                                        |
131 | `c`      | Open debug console                                          |
132 | `r`      | Reload the current level including the Player's position    |
133 | `q`      | Reload the current level preserving the Player's position   |
134 | `p`      | Toggle game pause                                           |
135 | `l`      | Toggle transparency on objects. Useful for debugging levels |
136 | `TAB`    | Switch to Level Editor                                      |
137 | `CTRL+q` | Quit the game                                               |
138
139 #### Gamepad
140
141 | Button       | Action                 |
142 |--------------|------------------------|
143 | `Left Stick` | Movement of the Player |
144 | `1`          | Jump                   |
145
146 ### ConsolĂ©
147
148 | Key       | Action                   |
149 |-----------|--------------------------|
150 | `ESC`     | Exit console             |
151 | `Enter`   | Evaluate the expression  |
152 | `Up/Down` | Traverse console history |
153
154 <!-- TODO(#914): Level Editor is not documented -->
155
156 ### Level Editor
157
158 To access the Level Editor open a level and press `TAB`.
159
160 | Key  | Action                 |
161 |------|------------------------|
162 | `F2` | Rename selected object |
163
164 ## Support
165
166 You can support my work via
167
168 - Twitch channel: https://www.twitch.tv/subs/tsoding
169 - Patreon: https://www.patreon.com/tsoding
170
171 [visual-studio]: https://www.visualstudio.com/
172 [svg2rects.py]: ./devtools/svg2rects.py
173 [./levels/]: ./levels/
174 [./levels/Makefile]: ./levels/Makefile
175 [gcc]: https://gcc.gnu.org/
176 [cmake]: https://cmake.org/
177 [libsdl2-dev]: https://www.libsdl.org/
178 [NixOS]: https://nixos.org/
179 [default.nix]: ./default.nix
180 [inotify-tools]: https://github.com/rvoicilas/inotify-tools