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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b89750ba2a79bf60c0b208634c0eb6fa0afc1b5d
4
- data.tar.gz: d60da4c30e994c77b9b27a696b4a9835ecedd8f3
3
+ metadata.gz: f8c60a8c6cd9a93b8e3b14cb778126465bbfd586
4
+ data.tar.gz: 9cd484e4314b78c348780efde91d91ff5c11c97f
5
5
  SHA512:
6
- metadata.gz: 6ac2147837ec6440df21d0534ac1e488275dd9942661cdc6341f378ec69721ef9d3a0552f2898806927d77efd024bdcb6a047a6422bfbbeee4bed14678b8f6ac
7
- data.tar.gz: 118fc9b4fadf79b34293040b8f7be7c2cdc70c981141675d92836a3c0e125ed57b0ba8dd551506aba8e917c1be73622b5abd0514a9ee45c626ca904d047f9634
6
+ metadata.gz: 8e0ea1e346db4662b209af422bb6a2b9ed783d3e5bb551e75da56a16ac3b6afc0405d1383cda6784adedd9bbc863b3e50cd43b2ac779d50fc6a7c0c0996e07ce
7
+ data.tar.gz: 9a8c7e07c5092d4748921ee5027b677f3ad92afc9740ec1b8939b6862ff5a6dc72de9fe59a919f2e5586766b6df44dadc0bd9f6221324974c2917cd8309ffbd4
@@ -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 |key_code|
22
- case key_code
23
- when 'q'.ord, TerminalGameEngine::Input::Keys::ESCAPE, TerminalGameEngine::Input::Keys::CTRL_C
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, key_code.chr
27
+ frame.draw_center 1, key.chr
28
28
  end
29
29
  end
30
30
 
@@ -1,8 +1,8 @@
1
1
  module TerminalGameEngine
2
2
  class Input
3
3
  module Keys
4
- CTRL_C = 3
5
- ESCAPE = 27
4
+ CTRL_C = ?\C-c
5
+ ESCAPE = "\e"
6
6
  end
7
7
 
8
8
  def self.call(&block)
@@ -1,3 +1,3 @@
1
1
  module TerminalGameEngine
2
- VERSION = '0.4.0'
2
+ VERSION = '0.4.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terminal_game_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Odin Dutton