terminal_game_engine 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/counter.rb +4 -4
- data/lib/terminal_game_engine/input.rb +2 -2
- data/lib/terminal_game_engine/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8c60a8c6cd9a93b8e3b14cb778126465bbfd586
|
4
|
+
data.tar.gz: 9cd484e4314b78c348780efde91d91ff5c11c97f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e0ea1e346db4662b209af422bb6a2b9ed783d3e5bb551e75da56a16ac3b6afc0405d1383cda6784adedd9bbc863b3e50cd43b2ac779d50fc6a7c0c0996e07ce
|
7
|
+
data.tar.gz: 9a8c7e07c5092d4748921ee5027b677f3ad92afc9740ec1b8939b6862ff5a6dc72de9fe59a919f2e5586766b6df44dadc0bd9f6221324974c2917cd8309ffbd4
|
data/examples/counter.rb
CHANGED
@@ -18,13 +18,13 @@ TerminalGameEngine.run do
|
|
18
18
|
frame.draw width-1, 0, '+'
|
19
19
|
frame.draw width-1, height-1, '+'
|
20
20
|
|
21
|
-
on_input do |
|
22
|
-
case
|
23
|
-
when 'q'
|
21
|
+
on_input do |key|
|
22
|
+
case key
|
23
|
+
when 'q', TerminalGameEngine::Input::Keys::ESCAPE, TerminalGameEngine::Input::Keys::CTRL_C
|
24
24
|
exit
|
25
25
|
else
|
26
26
|
frame.draw 0, 1, ' ' * (number.length + 1)
|
27
|
-
frame.draw_center 1,
|
27
|
+
frame.draw_center 1, key.chr
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|