arcade 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/arcade/base.rb +18 -1
- data/lib/arcade/version.rb +1 -1
- metadata +8 -8
data/lib/arcade/base.rb
CHANGED
@@ -264,10 +264,27 @@ class Arcade::GameObject
|
|
264
264
|
if !other.kind_of?(Arcade::GameObject) || other == self
|
265
265
|
false
|
266
266
|
else
|
267
|
-
!(bottom < other.top ||
|
267
|
+
hit = !(bottom < other.top ||
|
268
268
|
top > other.bottom ||
|
269
269
|
right < other.left ||
|
270
270
|
left > other.right)
|
271
|
+
|
272
|
+
if hit
|
273
|
+
other.hit_side = if bottom >= other.top && top <= other.top && left <= other.right && right >= other.left
|
274
|
+
:top
|
275
|
+
elsif bottom >= other.bottom && top <= other.bottom && left <= other.right && right >= other.left
|
276
|
+
:bottom
|
277
|
+
elsif bottom >= other.top && top <= other.bottom && right >= other.left && left <= other.left
|
278
|
+
:left
|
279
|
+
else
|
280
|
+
:right
|
281
|
+
end
|
282
|
+
|
283
|
+
else
|
284
|
+
other.hit_side = false
|
285
|
+
end
|
286
|
+
|
287
|
+
hit
|
271
288
|
end
|
272
289
|
end
|
273
290
|
|
data/lib/arcade/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arcade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &70221815374860 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70221815374860
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: gosu
|
27
|
-
requirement: &
|
27
|
+
requirement: &70221815374440 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70221815374440
|
36
36
|
description: ! 'Arcade is a simple Ruby-vased DSL for creating old-school arcade games
|
37
37
|
like Pong. The philosophy is similar to GameMaker, except expressed as a Ruby library
|
38
38
|
instead of a crazy GUI.
|
@@ -65,7 +65,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
65
|
version: '0'
|
66
66
|
segments:
|
67
67
|
- 0
|
68
|
-
hash:
|
68
|
+
hash: 1298018803895693101
|
69
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
70
|
none: false
|
71
71
|
requirements:
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
segments:
|
76
76
|
- 0
|
77
|
-
hash:
|
77
|
+
hash: 1298018803895693101
|
78
78
|
requirements: []
|
79
79
|
rubyforge_project:
|
80
80
|
rubygems_version: 1.8.17
|