bricks_meet_balls 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +15 -0
- data/examples/groonga/droonga-icon-full-size.png +0 -0
- data/examples/groonga/droonga-logo.png +0 -0
- data/examples/groonga/main.rb +36 -4
- data/examples/groonga/mroonga-icon-full-size.png +0 -0
- data/examples/groonga/mroonga-logo.png +0 -0
- data/examples/groonga/nroonga-icon-full-size.png +0 -0
- data/examples/groonga/nroonga-logo.png +0 -0
- data/examples/groonga/rroonga-icon-full-size.png +0 -0
- data/examples/groonga/rroonga-logo.png +0 -0
- data/lib/bricks_meet_balls/version.rb +1 -1
- data/lib/bricks_meet_balls/window.rb +15 -5
- metadata +10 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc30d72016b6b37442e2d9f47007c413d86bd82d
|
4
|
+
data.tar.gz: c036dfe4feceb8298a920c7eac307b8f1cce9f69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 678d5057c642c67f6b96aaad88925230dd786157881f517895de5a4982ed0b7b2605ae39a1d77698f37fee8fe4aac17a279773f621d0262bd6f77a35e82f9e02
|
7
|
+
data.tar.gz: 1d1adb3c67df3c98983fdcbfe768482f120e48b0f153d45ecf5ff92e98eb08e4fe552916930997f9edb2ac49cbd09c8e17c2e2a591a3d51796029ac0d8640125
|
data/NEWS.md
ADDED
Binary file
|
Binary file
|
data/examples/groonga/main.rb
CHANGED
@@ -3,9 +3,37 @@
|
|
3
3
|
# groonga-logo.png, groonga-icon-full-size.png:
|
4
4
|
# CC BY 3.0 - (c) The Groonga Project
|
5
5
|
#
|
6
|
+
# mroonga-logo.png, mroonga-icon-full-size.png:
|
7
|
+
# CC BY 3.0 - (c) The Mroonga Project
|
8
|
+
#
|
9
|
+
# rroonga-logo.png, rroonga-icon-full-size.png:
|
10
|
+
# CC BY 3.0 - (c) The Ranguba Project
|
11
|
+
#
|
12
|
+
# nroonga-logo.png, nroonga-icon-full-size.png:
|
13
|
+
# CC BY 3.0 - (c) The Nroonga Project
|
14
|
+
#
|
15
|
+
# droonga-logo.png, droonga-icon-full-size.png:
|
16
|
+
# CC BY 3.0 - (c) The Droonga Project
|
17
|
+
#
|
6
18
|
|
7
19
|
require "bricks_meet_balls"
|
8
20
|
|
21
|
+
BRICK_IMAGES = [
|
22
|
+
"groonga-logo.png",
|
23
|
+
"mroonga-logo.png",
|
24
|
+
"rroonga-logo.png",
|
25
|
+
"nroonga-logo.png",
|
26
|
+
"droonga-logo.png",
|
27
|
+
]
|
28
|
+
|
29
|
+
BALL_IMAGES = [
|
30
|
+
"groonga-icon-full-size.png",
|
31
|
+
"mroonga-icon-full-size.png",
|
32
|
+
"rroonga-icon-full-size.png",
|
33
|
+
"nroonga-icon-full-size.png",
|
34
|
+
"droonga-icon-full-size.png",
|
35
|
+
]
|
36
|
+
|
9
37
|
width = 640
|
10
38
|
height = 480
|
11
39
|
num_of_rows = 10
|
@@ -13,15 +41,19 @@ num_of_columns = 8
|
|
13
41
|
num_of_balls = 29
|
14
42
|
|
15
43
|
base_dir = File.expand_path(File.dirname(__FILE__))
|
16
|
-
|
17
|
-
|
44
|
+
ball_images = BALL_IMAGES.collect do |ball_image|
|
45
|
+
File.join(base_dir, ball_image)
|
46
|
+
end
|
47
|
+
brick_images = BRICK_IMAGES.collect do |brick_image|
|
48
|
+
File.join(base_dir, brick_image)
|
49
|
+
end
|
18
50
|
|
19
51
|
window = BricksMeetBalls::Window.new(width,
|
20
52
|
height,
|
21
53
|
num_of_rows,
|
22
54
|
num_of_columns,
|
23
55
|
num_of_balls,
|
24
|
-
|
25
|
-
|
56
|
+
ball_images,
|
57
|
+
brick_images)
|
26
58
|
|
27
59
|
window.show
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -12,7 +12,7 @@ module BricksMeetBalls
|
|
12
12
|
|
13
13
|
def initialize(width=240, height=480,
|
14
14
|
num_of_rows=2, num_of_columns=3, num_of_balls=1,
|
15
|
-
|
15
|
+
ball_images=nil, brick_images=nil)
|
16
16
|
super(width, height, false)
|
17
17
|
self.caption = "Bricks meet Balls"
|
18
18
|
@x1 = 0
|
@@ -23,8 +23,8 @@ module BricksMeetBalls
|
|
23
23
|
@balls = []
|
24
24
|
@bar = Bar.new(self)
|
25
25
|
@message = nil
|
26
|
-
@
|
27
|
-
@
|
26
|
+
@ball_images = ball_images
|
27
|
+
@brick_images = brick_images
|
28
28
|
create_bricks(num_of_columns, num_of_rows)
|
29
29
|
create_balls(num_of_balls)
|
30
30
|
end
|
@@ -106,12 +106,17 @@ module BricksMeetBalls
|
|
106
106
|
def create_bricks(num_of_columns, num_of_rows)
|
107
107
|
1.upto(num_of_columns) do |column|
|
108
108
|
1.upto(num_of_rows) do |row|
|
109
|
+
if @brick_images.is_a?(Array)
|
110
|
+
brick_image = @brick_images.sample
|
111
|
+
else
|
112
|
+
brick_image = @brick_images
|
113
|
+
end
|
109
114
|
@bricks << Brick.new(self,
|
110
115
|
column,
|
111
116
|
row,
|
112
117
|
self.width / num_of_columns,
|
113
118
|
self.width / num_of_columns / 3,
|
114
|
-
|
119
|
+
brick_image)
|
115
120
|
end
|
116
121
|
end
|
117
122
|
end
|
@@ -123,7 +128,12 @@ module BricksMeetBalls
|
|
123
128
|
end
|
124
129
|
|
125
130
|
def create_ball
|
126
|
-
|
131
|
+
if @ball_images.is_a?(Array)
|
132
|
+
ball_image = @ball_images.sample
|
133
|
+
else
|
134
|
+
ball_image = @ball_images
|
135
|
+
end
|
136
|
+
ball = Ball.new(self, ball_image)
|
127
137
|
ball.warp(self.width * 0.5,
|
128
138
|
self.height * 0.8)
|
129
139
|
@balls << ball
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bricks_meet_balls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masafumi Yokoyama
|
@@ -106,13 +106,22 @@ files:
|
|
106
106
|
- ".gitignore"
|
107
107
|
- Gemfile
|
108
108
|
- LICENSE.txt
|
109
|
+
- NEWS.md
|
109
110
|
- README.md
|
110
111
|
- Rakefile
|
111
112
|
- bin/bricks_meet_balls
|
112
113
|
- bricks_meet_balls.gemspec
|
114
|
+
- examples/groonga/droonga-icon-full-size.png
|
115
|
+
- examples/groonga/droonga-logo.png
|
113
116
|
- examples/groonga/groonga-icon-full-size.png
|
114
117
|
- examples/groonga/groonga-logo.png
|
115
118
|
- examples/groonga/main.rb
|
119
|
+
- examples/groonga/mroonga-icon-full-size.png
|
120
|
+
- examples/groonga/mroonga-logo.png
|
121
|
+
- examples/groonga/nroonga-icon-full-size.png
|
122
|
+
- examples/groonga/nroonga-logo.png
|
123
|
+
- examples/groonga/rroonga-icon-full-size.png
|
124
|
+
- examples/groonga/rroonga-logo.png
|
116
125
|
- lib/bricks_meet_balls.rb
|
117
126
|
- lib/bricks_meet_balls/ball.rb
|
118
127
|
- lib/bricks_meet_balls/bar.rb
|