a_maze_ing 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2df41350e874bea7b56bef6f11c7b439950bf7ab
4
- data.tar.gz: 6d7e772e5797cf37825ac0063faf75d9486906bd
3
+ metadata.gz: b7fb0b68dd5272233aacbaf58ba3171c3868b5bb
4
+ data.tar.gz: efb0b850c4c09a1b0e93df8ea343e65109ca47ae
5
5
  SHA512:
6
- metadata.gz: 0ef6f86e9eb7fcb2ab4952339457b7f71cdb1bce618326681f46e7dbd491f247c379e61597169922d9d850a8a414b0b8be9f32e6efbc24fe0f0b97f5aafd4a88
7
- data.tar.gz: 9ce6757902dc79d30b8f5b751bd39dbe2c76b4ed09e37dc4097fa996068d96dd54624c69bc9cf7beb3ca628e89776eb2a691c7a498acb10f77076d6026f8a8fd
6
+ metadata.gz: 1f2a6c7732b8cf21090d0a626925d178e7fd9933a91d75a7cacd62f89acbb63811e86e2f700c2e452c63ab6ef2b8f9265347455fe4b9e470be6ac048f9de6d03
7
+ data.tar.gz: '08fd8dc8244cf49114533fba404a97f00fcb56c9fd95391c7b03d69abc7d2684cfeffe69010bdd67416644fa0dd37403153d7231dd2a8030e3efbca4a047e147'
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ *.gem
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /Gemfile.lock
@@ -10,4 +11,3 @@
10
11
 
11
12
  # rspec failure tracking
12
13
  .rspec_status
13
- .gem
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  This is a small video game about maze, create on Gosu library. You need to find the way to specific point in the maze to win the game
4
4
 
5
- (./images/cover.jpg)
5
+ ![](./images/cover.jpg?raw=true)
6
6
 
7
7
  ## Requirements
8
8
 
@@ -45,4 +45,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
45
45
 
46
46
  ## Contributing
47
47
 
48
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/a_maze_ing.
48
+ Bug reports and pull requests are welcome on GitHub at https://github.com/at-cuongtran/a_maze_ing.
data/a_maze_ing.gemspec CHANGED
@@ -37,4 +37,5 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency "rake", "~> 10.0"
38
38
  spec.add_development_dependency "rspec", "~> 3.0"
39
39
  spec.add_runtime_dependency "gosu","~> 0.12.0"
40
+ spec.add_runtime_dependency "commander", "~> 4.4.3"
40
41
  end
data/bin/a_maze_ing CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
  require "a_maze_ing"
3
3
 
4
- AMazeIng::GameWindow.new.show
4
+ AMazeIng::CLI.new.run
5
+ # AMazeIng::GameWindow.new.show
@@ -0,0 +1,45 @@
1
+ require 'rubygems'
2
+ require 'commander'
3
+
4
+ module AMazeIng
5
+ class CLI
6
+ include Commander::Methods
7
+
8
+ def run
9
+ @full_screen = false
10
+
11
+ # program :name, AMazeIng::Configuration::PROGRAM_NAME
12
+ program :name, "AMazeIng"
13
+ program :version, AMazeIng::VERSION
14
+ # program :description, AMazeIng::Configuration::DESCRIPTION
15
+ program :description, "Maze solving game... don't be addicted"
16
+
17
+ default_command :classic
18
+
19
+ global_option('-f', '--fullscreen', 'Render window at full screen') {
20
+ @full_screen = true
21
+ }
22
+
23
+ command :classic do |c|
24
+ c.syntax = 'a_maze_ing classic [options]'
25
+ c.description = 'Classic mode, difficulty increase with level'
26
+ c.action do
27
+ AMazeIng::GameWindow.new(@full_screen).show
28
+ end
29
+ end
30
+ # command :bar do |c|
31
+ # c.syntax = 'foobar bar [options]'
32
+ # c.description = 'Display bar with optional prefix and suffix'
33
+ # c.option '-p', '--prefix STRING', String, 'Adds a prefix to bar'
34
+ # c.option '-s', '--suffix STRING', String, 'Adds a suffix to bar'
35
+ # c.action do |args, options|
36
+ # options.default :prefix => '(', :suffix => ')'
37
+ # say "#{options.prefix}bar#{options.suffix}"
38
+ # end
39
+ # end
40
+
41
+ run!
42
+ end
43
+
44
+ end
45
+ end
@@ -0,0 +1,11 @@
1
+ module AMazeIng
2
+ module Configuration
3
+
4
+ # Program configurations
5
+ PROGRAM_NAME = "AmazeIng".freeze
6
+ AUTHOR = "Cuong Tran <tranhuu.phucuong@gmail.com>".freeze
7
+ DESCRIPTION = "Maze solving game... don't be addicted".freeze
8
+ MORE_HELP_URL = "https://github.com/at-cuongtran/a_maze_ing".freeze
9
+
10
+ end
11
+ end
@@ -8,8 +8,8 @@ module AMazeIng
8
8
  SIDE_BAR = 180
9
9
  class GameWindow < Window
10
10
  $rows = $cols = 10
11
- def initialize
12
- super DIMENSION + SIDE_BAR, DIMENSION, false, 1
11
+ def initialize(full_screen)
12
+ super DIMENSION + SIDE_BAR, DIMENSION, full_screen, 1
13
13
  self.caption = "Maze"
14
14
  generate_maze
15
15
  @infor = Infor.new
@@ -1,3 +1,3 @@
1
1
  module AMazeIng
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/a_maze_ing.rb CHANGED
@@ -2,4 +2,5 @@ require "a_maze_ing/version"
2
2
  require "a_maze_ing/cell"
3
3
  require "a_maze_ing/player"
4
4
  require "a_maze_ing/infor"
5
- require "a_maze_ing/maze"
5
+ require "a_maze_ing/maze"
6
+ require "a_maze_ing/cli"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: a_maze_ing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - at-cuongtran
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.12.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: commander
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 4.4.3
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 4.4.3
69
83
  description: "A fun and easy to play maze game with graphic. \n Maze randomly generate
70
84
  with difficulty increase evey level"
71
85
  email:
@@ -88,6 +102,8 @@ files:
88
102
  - images/cover.jpg
89
103
  - lib/a_maze_ing.rb
90
104
  - lib/a_maze_ing/cell.rb
105
+ - lib/a_maze_ing/cli.rb
106
+ - lib/a_maze_ing/configuration.rb
91
107
  - lib/a_maze_ing/infor.rb
92
108
  - lib/a_maze_ing/maze.rb
93
109
  - lib/a_maze_ing/player.rb