rcade_controls 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -20
- data/lib/rcade_controls.rb +42 -13
- data/rcade_controls.gemspec +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b67908acf958b64ea1a5e0affb98fa51ebe26792
|
4
|
+
data.tar.gz: 3f04e7c34050627c81b75c307029137598bbc371
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa0dae5dfea4702bc83f92935ba3eb09648733ecdf091646213b2bce148c20f73a86d044fc97450eb235af2ed0ac585115cc4596da26cb1b7c35fa67a20cd678
|
7
|
+
data.tar.gz: 8ed3e384cef938acc82b4c64ef0a8555249db733286db06722c9d845118ca82095ea7b7dafcd557e47040931a956baa016409e0c70345046d167ba015c724f40
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
This library maps the [standard arcade controller
|
1
|
+
This library maps the [standard arcade controller keyboard mapping](http://www.ultimarc.com/ipac2.html) to Ruby constants that can be used when checking which button was pressed. This library assumes you're creating a Gosu game. Please submit a pull request if you would like to support other game libraries.
|
2
2
|
|
3
3
|
## Installation
|
4
4
|
|
@@ -22,27 +22,14 @@ In your game, you can check if the key pressed matches the button that you expec
|
|
22
22
|
class Game < Gosu::Window
|
23
23
|
def button_down(button)
|
24
24
|
case button
|
25
|
-
when Coin1, Coin2
|
26
|
-
|
27
|
-
when
|
28
|
-
|
29
|
-
when
|
30
|
-
move_player_one(button)
|
31
|
-
when P1Button1
|
32
|
-
attack!
|
33
|
-
when Escape
|
34
|
-
close
|
25
|
+
when Coin1, Coin2 then insert_coin
|
26
|
+
when P1Start then start_one_player_game
|
27
|
+
when P1Left, P1Right then move_player_one(button)
|
28
|
+
when P1Button1 then player_one_attack!
|
29
|
+
when Quit then close
|
35
30
|
end
|
36
31
|
end
|
37
32
|
end
|
38
33
|
```
|
39
34
|
|
40
|
-
For
|
41
|
-
|
42
|
-
## Contributing
|
43
|
-
|
44
|
-
1. Fork it
|
45
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
46
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
47
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
48
|
-
5. Create new Pull Request
|
35
|
+
For the full list of mappings, refer to the [source code](https://github.com/ruby-rcade/rcade_controls/blob/master/lib/rcade_controls.rb).
|
data/lib/rcade_controls.rb
CHANGED
@@ -2,24 +2,33 @@ require 'gosu'
|
|
2
2
|
|
3
3
|
module RcadeControls
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
# Coin Insert Buttons
|
7
6
|
Coin1 = Gosu::Kb5
|
8
7
|
Coin2 = Gosu::Kb6
|
9
8
|
Coin3 = Gosu::Kb7
|
10
9
|
Coin4 = Gosu::Kb8
|
11
10
|
|
11
|
+
# Start Buttons
|
12
12
|
P1Start = Gosu::Kb1
|
13
13
|
P2Start = Gosu::Kb2
|
14
14
|
P3Start = Gosu::Kb3
|
15
15
|
P4Start = Gosu::Kb4
|
16
16
|
|
17
|
+
# Miscellaneous Buttons
|
18
|
+
Escape = Gosu::KbEscape
|
19
|
+
Quit = Gosu::KbEscape
|
20
|
+
Enter = Gosu::KbReturn
|
21
|
+
Return = Gosu::KbReturn
|
22
|
+
Pause = Gosu::KbP
|
23
|
+
Tab = Gosu::KbTab
|
24
|
+
Options = Gosu::KbTab
|
25
|
+
|
26
|
+
# Player 1 Joystick
|
17
27
|
P1Up = Gosu::KbUp
|
18
28
|
P1Down = Gosu::KbDown
|
19
29
|
P1Left = Gosu::KbLeft
|
20
30
|
P1Right = Gosu::KbRight
|
21
|
-
|
22
|
-
P1ButtonB = Gosu::KbReturn
|
31
|
+
# Player 1 Buttons
|
23
32
|
P1Button1 = Gosu::KbLeftControl
|
24
33
|
P1Button2 = Gosu::KbLeftAlt
|
25
34
|
P1Button3 = Gosu::KbSpace
|
@@ -27,24 +36,44 @@ module RcadeControls
|
|
27
36
|
P1Button5 = Gosu::KbZ
|
28
37
|
P1Button6 = Gosu::KbX
|
29
38
|
P1Button7 = Gosu::KbC
|
30
|
-
P1Button8 = Gosu::KbV
|
31
|
-
P1Button9 = Gosu::KbB
|
32
|
-
P1Button10 = Gosu::KbN
|
39
|
+
P1Button8 = Gosu::KbV # Also used by P4 when in 4 player mode
|
33
40
|
|
41
|
+
# Player 2 Joystick
|
34
42
|
P2Up = Gosu::KbR
|
35
43
|
P2Down = Gosu::KbF
|
36
44
|
P2Left = Gosu::KbD
|
37
45
|
P2Right = Gosu::KbG
|
38
|
-
|
39
|
-
P2ButtonB = Gosu::KbEscape
|
46
|
+
# Player 2 Buttons
|
40
47
|
P2Button1 = Gosu::KbA
|
41
48
|
P2Button2 = Gosu::KbS
|
42
49
|
P2Button3 = Gosu::KbQ
|
43
50
|
P2Button4 = Gosu::KbW
|
44
|
-
P2Button5 = Gosu::KbI
|
45
|
-
P2Button6 = Gosu::KbK
|
46
|
-
P2Button7 = Gosu::KbJ
|
47
|
-
P2Button8 = Gosu::KbL
|
51
|
+
P2Button5 = Gosu::KbI # Also used by P3 when in 4 player mode
|
52
|
+
P2Button6 = Gosu::KbK # Also used by P3 when in 4 player mode
|
53
|
+
P2Button7 = Gosu::KbJ # Also used by P3 when in 4 player mode
|
54
|
+
P2Button8 = Gosu::KbL # Also used by P3 when in 4 player mode
|
55
|
+
|
56
|
+
# Player 3 Joystick
|
57
|
+
P3Up = Gosu::KbI
|
58
|
+
P3Down = Gosu::KbK
|
59
|
+
P3Left = Gosu::KbJ
|
60
|
+
P3Right = Gosu::KbL
|
61
|
+
# Player 3 Buttons
|
62
|
+
P3Button1 = Gosu::KbRightControl
|
63
|
+
P3Button2 = Gosu::KbRightShift
|
64
|
+
P3Button3 = Gosu::KbReturn
|
65
|
+
P3Button4 = Gosu::KbO
|
66
|
+
|
67
|
+
# Player 4 Joystick
|
68
|
+
P4Up = Gosu::KbY
|
69
|
+
P4Down = Gosu::KbN
|
70
|
+
P4Left = Gosu::KbV
|
71
|
+
P4Right = Gosu::KbU
|
72
|
+
# Player 4 Buttons
|
73
|
+
P4Button1 = Gosu::KbB
|
74
|
+
P4Button2 = Gosu::KbE
|
75
|
+
P4Button3 = Gosu::KbH
|
76
|
+
P4Button4 = Gosu::KbM
|
48
77
|
|
49
78
|
end
|
50
79
|
|
data/rcade_controls.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "rcade_controls"
|
5
|
-
spec.version = "0.0
|
5
|
+
spec.version = "0.1.0"
|
6
6
|
spec.authors = ["Andrew Havens"]
|
7
7
|
spec.email = ["email@andrewhavens.com"]
|
8
|
-
spec.description = %q{A
|
9
|
-
spec.summary = %q{A
|
8
|
+
spec.description = %q{A library of standard arcade controller keyboard mappings.}
|
9
|
+
spec.summary = %q{A library of standard arcade controller keyboard mappings.}
|
10
10
|
spec.homepage = "https://github.com/ruby-rcade/rcade_controls"
|
11
11
|
spec.license = "MIT"
|
12
12
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcade_controls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Havens
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gosu
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
-
description: A
|
55
|
+
description: A library of standard arcade controller keyboard mappings.
|
56
56
|
email:
|
57
57
|
- email@andrewhavens.com
|
58
58
|
executables: []
|
@@ -90,5 +90,5 @@ rubyforge_project:
|
|
90
90
|
rubygems_version: 2.0.2
|
91
91
|
signing_key:
|
92
92
|
specification_version: 4
|
93
|
-
summary: A
|
93
|
+
summary: A library of standard arcade controller keyboard mappings.
|
94
94
|
test_files: []
|