]> git.lizzy.rs Git - nothing.git/blob - README.md
Merge pull request #1135 from zhiayang/github-actions
[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 [![Build Status](https://github.com/tsoding/nothing/workflows/CI/badge.svg)](https://github.com/tsoding/nothing/actions)
5
6 # Nothing
7
8 ![](https://i.imgur.com/7mECYKU.gif)
9 ![](https://i.imgur.com/ABcJqB5.gif)
10
11 ## Dependencies
12
13 - [gcc] or [clang] or [MSVC 2015+][visual-studio]
14 - [cmake]
15 - [libsdl2-dev]
16
17 ### Ubuntu
18
19 ```console
20 $ sudo apt-get install gcc cmake libsdl2-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
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 $ ./nothing
66 ```
67
68 ### Windows
69
70 #### Visual Studio
71
72 - Enter the Visual Studio Command Line Development Environment https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line
73   - Basically just find `vcvarsall.bat` and run `vcvarsall.bat x64` inside of cmd
74 - Download [SDL2 VC Development Libraries](https://www.libsdl.org/release/SDL2-devel-2.0.9-VC.zip) and copy it to `path\to\nothing`
75
76 ```console
77 > cd path\to\nothing
78 > 7z x SDL2-devel-2.0.9-VC.zip
79 > move SDL2-2.0.9 SDL2
80 > mkdir build
81 > cd build
82 > cmake ..
83 > cmake --build .
84 > .\nothing
85 ```
86
87 #### MinGW (with MSYS)
88
89 ```console
90 $ cd path/to/nothing
91 $ wget https://www.libsdl.org/release/SDL2-devel-2.0.10-mingw.tar.gz
92 $ tar xzf SDL2-devel-2.0.10-mingw.tar.gz
93 $ mv SDL2-2.0.10 SDL2
94 $ rm SDL2-devel-2.0.10-mingw.tar.gz
95 $ mkdir build && cd build
96 $ cmake .. -G "MSYS Makefiles"
97 $ cmake --build .
98 $ ./nothing
99 ```
100
101 #### MinGW (without MSYS)
102 - 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`
103
104 ```console
105 > cd path\to\nothing
106 > 7z x SDL2-devel-2.0.10-mingw.tar.gz -so | 7z x -si -ttar
107 > move SDL2-2.0.10 SDL2
108 > del SDL2-devel-2.0.10-mingw.tar.gz
109 > mkdir build
110 > cd build
111 > cmake .. -G "MinGW Makefiles"
112 > cmake --build .
113 > .\nothing
114 ```
115
116 ## Controls
117
118 ### Game
119
120 #### Keyboard
121
122 | Key      | Action                                                      |
123 |----------|-------------------------------------------------------------|
124 | `d`      | Move to the right                                           |
125 | `a`      | Move to the left                                            |
126 | `SPACE`  | Jump                                                        |
127 | `c`      | Open debug console                                          |
128 | `r`      | Reload the current level including the Player's position    |
129 | `q`      | Reload the current level preserving the Player's position   |
130 | `p`      | Toggle game pause                                           |
131 | `l`      | Toggle transparency on objects. Useful for debugging levels |
132 | `TAB`    | Switch to Level Editor                                      |
133 | `CTRL+q` | Quit the game                                               |
134
135 #### Gamepad
136
137 | Button       | Action                 |
138 |--------------|------------------------|
139 | `Left Stick` | Movement of the Player |
140 | `1`          | Jump                   |
141
142 ### ConsolĂ©
143
144 | Key       | Action                   |
145 |-----------|--------------------------|
146 | `ESC`     | Exit console             |
147 | `Enter`   | Evaluate the expression  |
148 | `Up/Down` | Traverse console history |
149
150 <!-- TODO(#914): Level Editor is not documented -->
151
152 ### Level Editor
153
154 To access the Level Editor open a level and press `TAB`.
155
156 | Key  | Action                 |
157 |------|------------------------|
158 | `F2` | Rename selected object |
159
160 ## Support
161
162 You can support my work via
163
164 - Twitch channel: https://www.twitch.tv/subs/tsoding
165 - Patreon: https://www.patreon.com/tsoding
166
167 [visual-studio]: https://www.visualstudio.com/
168 [svg2rects.py]: ./devtools/svg2rects.py
169 [./levels/]: ./levels/
170 [./levels/Makefile]: ./levels/Makefile
171 [gcc]: https://gcc.gnu.org/
172 [clang]: https://clang.llvm.org/
173 [cmake]: https://cmake.org/
174 [libsdl2-dev]: https://www.libsdl.org/
175 [NixOS]: https://nixos.org/
176 [default.nix]: ./default.nix
177 [inotify-tools]: https://github.com/rvoicilas/inotify-tools