bloodymines 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/bloodymines +16 -6
- metadata +3 -3
data/bin/bloodymines
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# An example of how to use the bloodymines game egnine within a curses program.
|
3
3
|
|
4
|
+
require "optparse"
|
4
5
|
require File.dirname(__FILE__) + "/../lib/bloodymines"
|
5
6
|
require File.dirname(__FILE__) + "/../lib/bloodymines/tui"
|
6
7
|
|
@@ -9,15 +10,24 @@ class Bloodymines
|
|
9
10
|
end
|
10
11
|
|
11
12
|
# main app
|
12
|
-
|
13
|
-
|
13
|
+
options = {}
|
14
|
+
optparse = OptionParser.new do |opts|
|
15
|
+
opts.on('-h','--help', 'display this screen') { puts opts; exit }
|
16
|
+
opts.on('-d', '--difficulty DIFFICULTY', [:beginner, :intermediate, :expert],
|
17
|
+
"Set the difficulty of the game") do |d|
|
18
|
+
options[:difficulty] = d
|
19
|
+
end
|
20
|
+
end
|
14
21
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
22
|
+
begin
|
23
|
+
optparse.parse!
|
24
|
+
rescue OptionParser::MissingArgument, OptionParser::InvalidArgument
|
25
|
+
puts "The following difficulty levels are available: beginner, intermediate, expert"
|
26
|
+
puts optparse
|
27
|
+
exit
|
19
28
|
end
|
20
29
|
|
30
|
+
game = Bloodymines.new(:difficulty => options[:difficulty])
|
21
31
|
game.cursor_x = 0
|
22
32
|
game.cursor_y = 0
|
23
33
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bloodymines
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- !binary |
|