bricks_meet_balls 0.0.1
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 +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +35 -0
- data/Rakefile +9 -0
- data/bin/bricks_meet_balls +5 -0
- data/bricks_meet_balls.gemspec +28 -0
- data/examples/groonga/groonga-icon-full-size.png +0 -0
- data/examples/groonga/groonga-logo.png +0 -0
- data/examples/groonga/main.rb +27 -0
- data/lib/bricks_meet_balls/ball.rb +85 -0
- data/lib/bricks_meet_balls/bar.rb +37 -0
- data/lib/bricks_meet_balls/brick.rb +37 -0
- data/lib/bricks_meet_balls/command.rb +12 -0
- data/lib/bricks_meet_balls/message.rb +37 -0
- data/lib/bricks_meet_balls/util.rb +60 -0
- data/lib/bricks_meet_balls/version.rb +3 -0
- data/lib/bricks_meet_balls/window.rb +132 -0
- data/lib/bricks_meet_balls/z_order.rb +5 -0
- data/lib/bricks_meet_balls.rb +9 -0
- data/test/run-test.rb +11 -0
- data/test/test-window.rb +11 -0
- metadata +155 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 04d8256c3c29fe4b65ea916c07079c87ad8ed070
|
4
|
+
data.tar.gz: 09801514716fb838c0765a618768c00199c43cfe
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b2fe7c53b3860494587b747b3fce19d837c5fd2148c6a5e4456e73ead36925547dd8c4165b48c3da89bdcc204afd478aa435ad8938fe1e10f12f696cd5454c62
|
7
|
+
data.tar.gz: 7e7631034d55fe5912003b218e8c1f5cf52e25320378a164a3393cb2979d03a2b26d2a2da2d0bb2a789922755533bd41bdb2f92e475c565c695e6a8a33909eb5
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Masafumi Yokoyama
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Bricks meet Balls
|
2
|
+
|
3
|
+
A game template as Break the Bricks using Gosu and Ruby.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'bricks_meet_balls'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install bricks_meet_balls
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
### Demo
|
22
|
+
|
23
|
+
$ bricks_meet_balls
|
24
|
+
|
25
|
+
### Examples
|
26
|
+
|
27
|
+
See examples/ directory.
|
28
|
+
|
29
|
+
## Contributing
|
30
|
+
|
31
|
+
1. Fork it ( http://github.com/myokoym/bricks_meet_balls/fork )
|
32
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
33
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
34
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
35
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'bricks_meet_balls/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "bricks_meet_balls"
|
8
|
+
spec.version = BricksMeetBalls::VERSION
|
9
|
+
spec.authors = ["Masafumi Yokoyama"]
|
10
|
+
spec.email = ["myokoym@gmail.com"]
|
11
|
+
spec.summary = %q{A game template as Break the Bricks}
|
12
|
+
spec.description = %q{Bricks meet Balls is a game template as Break the Bricks using Gosu and Ruby.}
|
13
|
+
spec.homepage = "https://github.com/myokoym/bricks_meet_balls"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_runtime_dependency("gosu")
|
22
|
+
|
23
|
+
spec.add_development_dependency("test-unit")
|
24
|
+
spec.add_development_dependency("test-unit-notify")
|
25
|
+
spec.add_development_dependency("test-unit-rr")
|
26
|
+
spec.add_development_dependency("bundler", "~> 1.5")
|
27
|
+
spec.add_development_dependency("rake")
|
28
|
+
end
|
Binary file
|
Binary file
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# groonga-logo.png, groonga-icon-full-size.png:
|
4
|
+
# CC BY 3.0 - (c) The Groonga Project
|
5
|
+
#
|
6
|
+
|
7
|
+
require "bricks_meet_balls"
|
8
|
+
|
9
|
+
width = 640
|
10
|
+
height = 480
|
11
|
+
num_of_rows = 10
|
12
|
+
num_of_columns = 8
|
13
|
+
num_of_balls = 29
|
14
|
+
|
15
|
+
base_dir = File.expand_path(File.dirname(__FILE__))
|
16
|
+
ball_image = File.join(base_dir, "groonga-icon-full-size.png")
|
17
|
+
brick_image = File.join(base_dir, "groonga-logo.png")
|
18
|
+
|
19
|
+
window = BricksMeetBalls::Window.new(width,
|
20
|
+
height,
|
21
|
+
num_of_rows,
|
22
|
+
num_of_columns,
|
23
|
+
num_of_balls,
|
24
|
+
ball_image,
|
25
|
+
brick_image)
|
26
|
+
|
27
|
+
window.show
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require "gosu"
|
2
|
+
require "bricks_meet_balls/util"
|
3
|
+
require "bricks_meet_balls/z_order"
|
4
|
+
|
5
|
+
module BricksMeetBalls
|
6
|
+
class Ball
|
7
|
+
include Util
|
8
|
+
|
9
|
+
attr_reader :x, :y
|
10
|
+
|
11
|
+
def initialize(window, image_path=nil)
|
12
|
+
@window = window
|
13
|
+
@x = @y = 0.0
|
14
|
+
@ball_radius = @window.height * 0.01
|
15
|
+
@angle = 30 + (5.0 * [*1..10, *14..24].sample) - 90
|
16
|
+
@speed = @window.height * 0.005
|
17
|
+
@moving = true
|
18
|
+
if image_path
|
19
|
+
@ball_radius *= 2
|
20
|
+
@image = Gosu::Image.new(@window, image_path, false)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def draw
|
25
|
+
if @image
|
26
|
+
@image.draw(@x - @ball_radius,
|
27
|
+
@y - @ball_radius,
|
28
|
+
ZOrder::Ball,
|
29
|
+
2.0 * @ball_radius / @image.width,
|
30
|
+
2.0 * @ball_radius / @image.height)
|
31
|
+
else
|
32
|
+
draw_frame(@window,
|
33
|
+
@x - @ball_radius, @y - @ball_radius,
|
34
|
+
@x + @ball_radius, @y + @ball_radius,
|
35
|
+
Gosu::Color::BLACK, ZOrder::Ball)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def warp(x, y)
|
40
|
+
@x, @y = x, y
|
41
|
+
end
|
42
|
+
|
43
|
+
def move
|
44
|
+
return unless @moving
|
45
|
+
@x += Gosu.offset_x(@angle, @speed)
|
46
|
+
@y += Gosu.offset_y(@angle, @speed)
|
47
|
+
end
|
48
|
+
|
49
|
+
def moving?
|
50
|
+
@moving
|
51
|
+
end
|
52
|
+
|
53
|
+
def stop
|
54
|
+
@moving = false
|
55
|
+
end
|
56
|
+
|
57
|
+
def start
|
58
|
+
@moving = true
|
59
|
+
end
|
60
|
+
|
61
|
+
def reflect(target)
|
62
|
+
if target.hit_on_top_or_bottom?(@x, @y)
|
63
|
+
reflect_x_axis
|
64
|
+
elsif target.hit_on_left_or_right?(@x, @y)
|
65
|
+
reflect_y_axis
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def reflect_x_axis
|
70
|
+
if @angle <= 180
|
71
|
+
@angle = 180 - @angle
|
72
|
+
else
|
73
|
+
@angle = 360 - (@angle - 180)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def reflect_y_axis
|
78
|
+
if @angle <= 180
|
79
|
+
@angle = 180 + (180 - @angle)
|
80
|
+
else
|
81
|
+
@angle = 360 - @angle
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "gosu"
|
2
|
+
require "bricks_meet_balls/util"
|
3
|
+
require "bricks_meet_balls/z_order"
|
4
|
+
|
5
|
+
module BricksMeetBalls
|
6
|
+
class Bar
|
7
|
+
include Util
|
8
|
+
|
9
|
+
def initialize(window)
|
10
|
+
@window = window
|
11
|
+
@width = @window.width * 0.3
|
12
|
+
@height = @window.height * 0.01
|
13
|
+
@x1 = @window.width * 0.5
|
14
|
+
@y1 = @window.height * 0.9
|
15
|
+
@x2 = @x1 + @width
|
16
|
+
@y2 = @y1 + @height
|
17
|
+
@movement = @width * 0.04
|
18
|
+
end
|
19
|
+
|
20
|
+
def draw
|
21
|
+
draw_square(@window,
|
22
|
+
@x1, @y1,
|
23
|
+
@x2, @y2,
|
24
|
+
Gosu::Color::BLACK, ZOrder::Bar)
|
25
|
+
end
|
26
|
+
|
27
|
+
def move_left
|
28
|
+
@x1 -= @movement
|
29
|
+
@x2 = @x1 + @width
|
30
|
+
end
|
31
|
+
|
32
|
+
def move_right
|
33
|
+
@x1 += @movement
|
34
|
+
@x2 = @x1 + @width
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "gosu"
|
2
|
+
require "bricks_meet_balls/util"
|
3
|
+
require "bricks_meet_balls/z_order"
|
4
|
+
|
5
|
+
module BricksMeetBalls
|
6
|
+
class Brick
|
7
|
+
include Util
|
8
|
+
|
9
|
+
def initialize(window, x, y, width, height, image_path=nil)
|
10
|
+
@window = window
|
11
|
+
@width = width
|
12
|
+
@height = height
|
13
|
+
@margin = @width * 0.01
|
14
|
+
@border_width = @width * 0.01 + @margin
|
15
|
+
@x1 = 1.0 * @width * (x - 1)
|
16
|
+
@y1 = 1.0 * @height * (y - 1)
|
17
|
+
@x2 = 1.0 * @width * x
|
18
|
+
@y2 = 1.0 * @height * y
|
19
|
+
if image_path
|
20
|
+
@image = Gosu::Image.new(@window, image_path, false)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def draw
|
25
|
+
draw_frame(@window,
|
26
|
+
@x1, @y1,
|
27
|
+
@x2, @y2,
|
28
|
+
Gosu::Color::BLACK, ZOrder::Brick)
|
29
|
+
return unless @image
|
30
|
+
@image.draw(@x1 + @border_width,
|
31
|
+
@y1 + @border_width,
|
32
|
+
ZOrder::Brick,
|
33
|
+
(0.95* @width / @image.width),
|
34
|
+
(0.95 * @height / @image.height))
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "gosu"
|
2
|
+
require "bricks_meet_balls/util"
|
3
|
+
require "bricks_meet_balls/z_order"
|
4
|
+
|
5
|
+
module BricksMeetBalls
|
6
|
+
class Message
|
7
|
+
def initialize(window, text)
|
8
|
+
@window = window
|
9
|
+
font_height = @window.width * 2 / max_length_each_lines(text)
|
10
|
+
line_spacing = @window.height / 20
|
11
|
+
@text = Gosu::Image.from_text(@window,
|
12
|
+
text,
|
13
|
+
Gosu.default_font_name,
|
14
|
+
font_height,
|
15
|
+
line_spacing,
|
16
|
+
@window.width,
|
17
|
+
:center)
|
18
|
+
end
|
19
|
+
|
20
|
+
def draw
|
21
|
+
@text.draw(0, @window.height / 3,
|
22
|
+
ZOrder::Message,
|
23
|
+
1, 1,
|
24
|
+
Gosu::Color::BLACK)
|
25
|
+
end
|
26
|
+
|
27
|
+
def max_length_each_lines(text)
|
28
|
+
max_length = 0
|
29
|
+
text.each_line do |line|
|
30
|
+
if max_length < line.length
|
31
|
+
max_length = line.length
|
32
|
+
end
|
33
|
+
end
|
34
|
+
max_length
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require "gosu"
|
2
|
+
|
3
|
+
module BricksMeetBalls
|
4
|
+
module Util
|
5
|
+
def draw_square(window, x1, y1, x2, y2, color, z_order=0)
|
6
|
+
window.draw_quad(x1, y1, color,
|
7
|
+
x2, y1, color,
|
8
|
+
x1, y2, color,
|
9
|
+
x2, y2, color,
|
10
|
+
z_order)
|
11
|
+
end
|
12
|
+
|
13
|
+
def draw_frame(window, x1, y1, x2, y2, color, z_order=0)
|
14
|
+
window.draw_line(x1, y1, color,
|
15
|
+
x2, y1, color,
|
16
|
+
z_order)
|
17
|
+
window.draw_line(x1, y1, color,
|
18
|
+
x1, y2, color,
|
19
|
+
z_order)
|
20
|
+
window.draw_line(x1, y2, color,
|
21
|
+
x2, y2, color,
|
22
|
+
z_order)
|
23
|
+
window.draw_line(x2, y1, color,
|
24
|
+
x2, y2, color,
|
25
|
+
z_order)
|
26
|
+
end
|
27
|
+
|
28
|
+
def hit?(x, y)
|
29
|
+
x >= @x1 && x <= @x2 &&
|
30
|
+
y >= @y1 && y <= @y2
|
31
|
+
end
|
32
|
+
|
33
|
+
def hit_on_top_or_bottom?(x, y)
|
34
|
+
[(@x1 - x).abs, (@x2 - x).abs].min >=
|
35
|
+
[(@y1 - y).abs, (@y2 - y).abs].min
|
36
|
+
end
|
37
|
+
|
38
|
+
def hit_on_left_or_right?(x, y)
|
39
|
+
[(@x1 - x).abs, (@x2 - x).abs].min <
|
40
|
+
[(@y1 - y).abs, (@y2 - y).abs].min
|
41
|
+
end
|
42
|
+
|
43
|
+
def out_from_left_or_right?(x)
|
44
|
+
x <= @x1 ||
|
45
|
+
x >= @x2
|
46
|
+
end
|
47
|
+
|
48
|
+
def out_from_top?(y)
|
49
|
+
y <= @y1
|
50
|
+
end
|
51
|
+
|
52
|
+
def drop?(y)
|
53
|
+
y > @y2
|
54
|
+
end
|
55
|
+
|
56
|
+
def base_dir
|
57
|
+
@base_dir ||= File.expand_path(File.dirname(__FILE__))
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
require "gosu"
|
2
|
+
require "bricks_meet_balls/util"
|
3
|
+
require "bricks_meet_balls/z_order"
|
4
|
+
require "bricks_meet_balls/brick"
|
5
|
+
require "bricks_meet_balls/ball"
|
6
|
+
require "bricks_meet_balls/bar"
|
7
|
+
require "bricks_meet_balls/message"
|
8
|
+
|
9
|
+
module BricksMeetBalls
|
10
|
+
class Window < Gosu::Window
|
11
|
+
include Util
|
12
|
+
|
13
|
+
def initialize(width=240, height=480,
|
14
|
+
num_of_rows=2, num_of_columns=3, num_of_balls=1,
|
15
|
+
ball_image=nil, brick_image=nil)
|
16
|
+
super(width, height, false)
|
17
|
+
self.caption = "Bricks meet Balls"
|
18
|
+
@x1 = 0
|
19
|
+
@y1 = 0
|
20
|
+
@x2 = width
|
21
|
+
@y2 = height
|
22
|
+
@bricks = []
|
23
|
+
@balls = []
|
24
|
+
@bar = Bar.new(self)
|
25
|
+
@message = nil
|
26
|
+
@ball_image = ball_image
|
27
|
+
@brick_image = brick_image
|
28
|
+
create_bricks(num_of_columns, num_of_rows)
|
29
|
+
create_balls(num_of_balls)
|
30
|
+
end
|
31
|
+
|
32
|
+
def update
|
33
|
+
if button_down?(Gosu::KbLeft) ||
|
34
|
+
button_down?(Gosu::MsLeft)
|
35
|
+
@bar.move_left
|
36
|
+
end
|
37
|
+
if button_down?(Gosu::KbRight) ||
|
38
|
+
button_down?(Gosu::MsRight)
|
39
|
+
@bar.move_right
|
40
|
+
end
|
41
|
+
|
42
|
+
@balls.each do |ball|
|
43
|
+
ball.move
|
44
|
+
|
45
|
+
@bricks.each do |brick|
|
46
|
+
if brick.hit?(ball.x, ball.y)
|
47
|
+
@bricks.delete(brick)
|
48
|
+
ball.reflect(brick)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
if @bar.hit?(ball.x, ball.y)
|
52
|
+
ball.reflect(@bar)
|
53
|
+
end
|
54
|
+
if self.out_from_left_or_right?(ball.x)
|
55
|
+
ball.reflect_y_axis
|
56
|
+
elsif self.out_from_top?(ball.y)
|
57
|
+
ball.reflect_x_axis
|
58
|
+
end
|
59
|
+
|
60
|
+
if self.drop?(ball.y)
|
61
|
+
@balls.delete(ball)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
if @message.nil? && @balls.empty?
|
66
|
+
@message = Message.new(self, "Game Over...")
|
67
|
+
end
|
68
|
+
if @message.nil? && @bricks.empty?
|
69
|
+
@message = Message.new(self, "Congratulations!")
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def draw
|
74
|
+
draw_area
|
75
|
+
@bricks.each {|brick| brick.draw }
|
76
|
+
@balls.each {|ball| ball.draw }
|
77
|
+
@bar.draw
|
78
|
+
@message.draw if @message
|
79
|
+
end
|
80
|
+
|
81
|
+
def button_down(id)
|
82
|
+
case id
|
83
|
+
when Gosu::KbSpace
|
84
|
+
@balls.each do |ball|
|
85
|
+
if ball.moving?
|
86
|
+
ball.stop
|
87
|
+
else
|
88
|
+
ball.start
|
89
|
+
end
|
90
|
+
end
|
91
|
+
when Gosu::KbInsert
|
92
|
+
create_ball
|
93
|
+
when Gosu::KbEscape
|
94
|
+
close
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
private
|
99
|
+
def draw_area
|
100
|
+
draw_square(self,
|
101
|
+
0, 0,
|
102
|
+
self.width, self.height,
|
103
|
+
Gosu::Color::WHITE, ZOrder::Background)
|
104
|
+
end
|
105
|
+
|
106
|
+
def create_bricks(num_of_columns, num_of_rows)
|
107
|
+
1.upto(num_of_columns) do |column|
|
108
|
+
1.upto(num_of_rows) do |row|
|
109
|
+
@bricks << Brick.new(self,
|
110
|
+
column,
|
111
|
+
row,
|
112
|
+
self.width / num_of_columns,
|
113
|
+
self.width / num_of_columns / 3,
|
114
|
+
@brick_image)
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
def create_balls(n)
|
120
|
+
n.times do
|
121
|
+
create_ball
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
def create_ball
|
126
|
+
ball = Ball.new(self, @ball_image)
|
127
|
+
ball.warp(self.width * 0.5,
|
128
|
+
self.height * 0.8)
|
129
|
+
@balls << ball
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
data/test/run-test.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "test-unit"
|
4
|
+
require "test/unit/notify"
|
5
|
+
require "test/unit/rr"
|
6
|
+
|
7
|
+
base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
|
8
|
+
test_dir = File.join(base_dir, "test")
|
9
|
+
$LOAD_PATH.unshift(test_dir)
|
10
|
+
|
11
|
+
exit Test::Unit::AutoRunner.run(true, test_dir)
|
data/test/test-window.rb
ADDED
metadata
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bricks_meet_balls
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Masafumi Yokoyama
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-03-25 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: gosu
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: test-unit
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: test-unit-notify
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: test-unit-rr
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.5'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.5'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: Bricks meet Balls is a game template as Break the Bricks using Gosu and
|
98
|
+
Ruby.
|
99
|
+
email:
|
100
|
+
- myokoym@gmail.com
|
101
|
+
executables:
|
102
|
+
- bricks_meet_balls
|
103
|
+
extensions: []
|
104
|
+
extra_rdoc_files: []
|
105
|
+
files:
|
106
|
+
- ".gitignore"
|
107
|
+
- Gemfile
|
108
|
+
- LICENSE.txt
|
109
|
+
- README.md
|
110
|
+
- Rakefile
|
111
|
+
- bin/bricks_meet_balls
|
112
|
+
- bricks_meet_balls.gemspec
|
113
|
+
- examples/groonga/groonga-icon-full-size.png
|
114
|
+
- examples/groonga/groonga-logo.png
|
115
|
+
- examples/groonga/main.rb
|
116
|
+
- lib/bricks_meet_balls.rb
|
117
|
+
- lib/bricks_meet_balls/ball.rb
|
118
|
+
- lib/bricks_meet_balls/bar.rb
|
119
|
+
- lib/bricks_meet_balls/brick.rb
|
120
|
+
- lib/bricks_meet_balls/command.rb
|
121
|
+
- lib/bricks_meet_balls/message.rb
|
122
|
+
- lib/bricks_meet_balls/util.rb
|
123
|
+
- lib/bricks_meet_balls/version.rb
|
124
|
+
- lib/bricks_meet_balls/window.rb
|
125
|
+
- lib/bricks_meet_balls/z_order.rb
|
126
|
+
- test/run-test.rb
|
127
|
+
- test/test-window.rb
|
128
|
+
homepage: https://github.com/myokoym/bricks_meet_balls
|
129
|
+
licenses:
|
130
|
+
- MIT
|
131
|
+
metadata: {}
|
132
|
+
post_install_message:
|
133
|
+
rdoc_options: []
|
134
|
+
require_paths:
|
135
|
+
- lib
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubyforge_project:
|
148
|
+
rubygems_version: 2.2.2
|
149
|
+
signing_key:
|
150
|
+
specification_version: 4
|
151
|
+
summary: A game template as Break the Bricks
|
152
|
+
test_files:
|
153
|
+
- test/run-test.rb
|
154
|
+
- test/test-window.rb
|
155
|
+
has_rdoc:
|