yeah 0.3.3 → 0.3.4
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 +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +14 -10
- data/bin/yeah +1 -0
- data/lib/yeah/_platform/asset.rb +4 -3
- data/lib/yeah/vector.rb +23 -15
- data/lib/yeah/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e63e1abe8491c77fbd17d9ae4b040bf8349afba3
|
4
|
+
data.tar.gz: d4d7d868f5f130a4bf1949d5b3eedc4b4a84f329
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d77b196bb0caf20f8f5a95ff68c8cbe001508dbab5c138dbc7e3eab6cc3dac345bf2fc863203ea9873189a9c97ad98a66e4f0d31d6608520a28d14403b686569
|
7
|
+
data.tar.gz: d66c9ff09bf63fd247d22d1cf83866ea54aec9ab124309bb3aff0f8d49981ba71d57142bb6fa00934a963005f4fa792b4d260ff58cd4ab25592fcff764cb83cf
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
0.3.4 (2014-08-22)
|
2
|
+
------------------
|
3
|
+
* Fixed `yeah version` command (thanks Chris Olszewski)
|
4
|
+
* Fixed `Vector#normalize` (thanks meganemura)
|
5
|
+
* Flattened `Vector` math operator code
|
6
|
+
* `Vector#magnitude` as alias for `Vector#length`
|
7
|
+
* `Vector#unit` as alias for `Vector#normalize`
|
8
|
+
* Updated documentation
|
9
|
+
|
10
|
+
0.3.3 (2014-08-18)
|
11
|
+
------------------
|
12
|
+
* Fixed missing require for `yeah new` command (thanks audy)
|
13
|
+
|
14
|
+
0.3.2 (2014-08-18)
|
15
|
+
------------------
|
16
|
+
* First substantial working release!
|
data/README.md
CHANGED
@@ -16,15 +16,15 @@ Practical Ruby video game framework, alpha stage
|
|
16
16
|
|
17
17
|
## Examples
|
18
18
|
|
19
|
-
[
|
19
|
+
[Code for all examples](https://github.com/yeahrb/examples)
|
20
20
|
|
21
|
-
[
|
22
|
-
[(code)](https://github.com/yeahrb/yeah/tree/examples/examples/asteroids)
|
21
|
+
[](https://yeahrb.github.io/examples/asteroids/runner.html)
|
23
22
|
|
24
|
-
[
|
23
|
+
[*Asteroids*](https://yeahrb.github.io/examples/asteroids/runner.html)
|
25
24
|
|
26
|
-
[
|
27
|
-
|
25
|
+
[](https://yeahrb.github.io/examples/random/runner.html)
|
26
|
+
|
27
|
+
[*Random*](https://yeahrb.github.io/examples/random/runner.html)
|
28
28
|
|
29
29
|
|
30
30
|
## Usage
|
@@ -41,12 +41,16 @@ NOTE: This is alpha-stage software, expect changes!
|
|
41
41
|
|
42
42
|
1. In a command line, enter `yeah new` to generate a new game project.
|
43
43
|
2. Change into the new `game` directory, then enter `bundle install`.
|
44
|
-
3. Add game code to `code/game.rb`. No tutorials yet; please take a look at the [example code](https://github.com/yeahrb/
|
44
|
+
3. Add game code to `code/game.rb`. No tutorials yet; please take a look at the [example code](https://github.com/yeahrb/examples) and [API reference](http://rdoc.info/github/yeahrb/yeah/9f065a6/frames).
|
45
45
|
4. Enter `yeah serve` and visit [http://localhost:1234](http://localhost:1234) to try the game.
|
46
46
|
|
47
47
|
|
48
|
-
##
|
48
|
+
## Links
|
49
|
+
|
50
|
+
[0.3.3 API reference](http://rdoc.info/github/yeahrb/yeah/9f065a6/frames)
|
51
|
+
|
52
|
+
[Issue & feature tracker](https://github.com/yeahrb/yeah/issues)
|
49
53
|
|
50
|
-
[
|
54
|
+
[Discussion via Gitter](https://gitter.im/yeahrb/yeah)
|
51
55
|
|
52
|
-
[
|
56
|
+
[Author's email](mailto:skoofoo@gmail.com)
|
data/bin/yeah
CHANGED
data/lib/yeah/_platform/asset.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
module Yeah
|
2
2
|
|
3
|
-
# An `Asset` represents a file found in a project's `assets
|
3
|
+
# An `Asset` represents a file found in a project's `assets/` directory.
|
4
4
|
# @abstract Provided by a `Platform`, subclassed to more specific assets.
|
5
5
|
class Asset
|
6
|
+
# @param [String] path relative to `assets/`
|
6
7
|
def initialize(path)
|
7
8
|
raise NotImplementedError
|
8
9
|
end
|
@@ -15,8 +16,8 @@ class Asset
|
|
15
16
|
end
|
16
17
|
|
17
18
|
# @!attribute path
|
18
|
-
# @param [String] path to asset relative to `assets
|
19
|
-
# @return [String] path to asset relative to `assets
|
19
|
+
# @param [String] path to asset relative to `assets/`
|
20
|
+
# @return [String] path to asset relative to `assets/`
|
20
21
|
|
21
22
|
# @!method to_n
|
22
23
|
# @return [Native] native representation of asset for platform
|
data/lib/yeah/vector.rb
CHANGED
@@ -65,37 +65,45 @@ class Vector
|
|
65
65
|
Math.sqrt(@components[0] ** 2 + @components[1] ** 2 + @components[2] ** 2)
|
66
66
|
end
|
67
67
|
|
68
|
+
alias :magnitude :length
|
69
|
+
|
68
70
|
# @return [Vector] vector of same direction whose length is 1
|
69
71
|
def normalize
|
70
|
-
self /
|
72
|
+
self / length
|
71
73
|
end
|
72
74
|
|
75
|
+
alias :unit :normalize
|
76
|
+
|
73
77
|
# @param [Vector] vector to add
|
74
|
-
# @return [Vector] vector
|
78
|
+
# @return [Vector] vector sum
|
75
79
|
def +(vector)
|
76
|
-
self.class.new(
|
77
|
-
|
78
|
-
|
80
|
+
self.class.new(@components[0] + vector.components[0],
|
81
|
+
@components[1] + vector.components[1],
|
82
|
+
@components[2] + vector.components[2])
|
79
83
|
end
|
80
84
|
|
81
85
|
# @param [Vector] vector to subtract
|
82
|
-
# @return [Vector] vector
|
86
|
+
# @return [Vector] vector difference
|
83
87
|
def -(vector)
|
84
|
-
self.class.new(
|
85
|
-
|
86
|
-
|
88
|
+
self.class.new(@components[0] - vector.components[0],
|
89
|
+
@components[1] - vector.components[1],
|
90
|
+
@components[2] - vector.components[2])
|
87
91
|
end
|
88
92
|
|
89
|
-
# @param [Numeric] numeric
|
90
|
-
# @return [Vector] vector
|
93
|
+
# @param [Numeric] numeric to multiply vector by
|
94
|
+
# @return [Vector] vector product
|
91
95
|
def *(numeric)
|
92
|
-
self.class.new(
|
96
|
+
self.class.new(@components[0] * numeric,
|
97
|
+
@components[1] * numeric,
|
98
|
+
@components[2] * numeric)
|
93
99
|
end
|
94
100
|
|
95
|
-
# @param [Numeric] numeric
|
96
|
-
# @return [Vector] vector
|
101
|
+
# @param [Numeric] numeric to divide vector by
|
102
|
+
# @return [Vector] vector quotient
|
97
103
|
def /(numeric)
|
98
|
-
self.class.new(
|
104
|
+
self.class.new(@components[0] / numeric,
|
105
|
+
@components[1] / numeric,
|
106
|
+
@components[2] / numeric)
|
99
107
|
end
|
100
108
|
|
101
109
|
# @return [Vector] identical vector
|
data/lib/yeah/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yeah
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artur Ostrega
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -88,6 +88,7 @@ executables:
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
+
- CHANGELOG.md
|
91
92
|
- LICENSE.txt
|
92
93
|
- README.md
|
93
94
|
- bin/yeah
|
@@ -122,7 +123,7 @@ files:
|
|
122
123
|
- opal/yeah/web/mouse.opal
|
123
124
|
- opal/yeah/web/sound.opal
|
124
125
|
- opal/yeah/web/ticker.opal
|
125
|
-
homepage: https://github.com/
|
126
|
+
homepage: https://github.com/yeahrb/yeah
|
126
127
|
licenses:
|
127
128
|
- MIT
|
128
129
|
metadata: {}
|