opal-phaser 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -2
- data/Gemfile +2 -0
- data/demo/app/main.rb +1 -1
- data/demo/config.ru +3 -3
- data/lib/opal/phaser.rb +0 -2
- data/lib/opal/phaser/animation/files.rb +4 -0
- data/lib/opal/phaser/core/files.rb +8 -0
- data/lib/opal/phaser/core/game.rb +7 -6
- data/lib/opal/phaser/core/group.rb +1 -0
- data/lib/opal/phaser/game_objects/files.rb +7 -0
- data/lib/opal/phaser/game_objects/game_object_factory.rb +6 -6
- data/lib/opal/phaser/game_objects/sprite.rb +2 -2
- data/lib/opal/phaser/game_objects/tile_sprite.rb +7 -0
- data/lib/opal/phaser/input/files.rb +4 -0
- data/lib/opal/phaser/input/input.rb +3 -0
- data/lib/opal/phaser/input/key.rb +8 -0
- data/lib/opal/phaser/input/keyboard.rb +9 -0
- data/lib/opal/phaser/loader/files.rb +2 -0
- data/lib/opal/phaser/math/files.rb +2 -0
- data/lib/opal/phaser/math/random_data_generator.rb +7 -0
- data/lib/opal/phaser/physics/files.rb +2 -0
- data/lib/opal/phaser/physics/physics.rb +15 -0
- data/lib/opal/phaser/setup.rb +12 -27
- data/lib/opal/phaser/time/files.rb +4 -0
- data/lib/opal/phaser/time/time.rb +12 -0
- data/lib/opal/phaser/time/timer.rb +10 -0
- data/lib/opal/phaser/time/timer_event.rb +8 -0
- data/lib/opal/phaser/tween/files.rb +2 -0
- data/lib/opal/phaser/version.rb +1 -1
- data/opal-phaser.gemspec +1 -2
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4873e726f3744eff28476ab8ebe398f2b4b12001
|
4
|
+
data.tar.gz: 47f4dd07619d9a6243b903ab6cf5ca20f9aa41ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4d43d58ada4ed74e1f975b66a57b64bbb0db8067a772caf436504cbade717dca0e4b64a9b396b868406acacc986455988ecc1b36d6d04ae29d61fb2cfc27c8a
|
7
|
+
data.tar.gz: 77dfa6968cfdf015710ac6b82588c29cdb595a7eac0c0c375c3ea5a6f123164c056a381be91dfe0bde3b9ea49f2b7dd50bf8e30292781f20493b3bb32bbad9d6
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/demo/app/main.rb
CHANGED
@@ -121,7 +121,7 @@ class Player
|
|
121
121
|
|
122
122
|
player.body.bounce.y = 0.2
|
123
123
|
player.body.gravity.y = 300
|
124
|
-
player.body.
|
124
|
+
player.body.collide_world_bounds = true
|
125
125
|
|
126
126
|
player.animations.add('left', [0, 1, 2, 3], 10, true)
|
127
127
|
player.animations.add('right', [5, 6, 7, 8], 10, true)
|
data/demo/config.ru
CHANGED
data/lib/opal/phaser.rb
CHANGED
@@ -0,0 +1,8 @@
|
|
1
|
+
# These requires must be loaded in order of dependency:
|
2
|
+
# TODO: look into why `puts File.dirname(__FILE__)` is not working for Opal
|
3
|
+
|
4
|
+
require 'opal/phaser/core/state'
|
5
|
+
require 'opal/phaser/core/anchor'
|
6
|
+
require 'opal/phaser/core/group'
|
7
|
+
require 'opal/phaser/core/signal'
|
8
|
+
require 'opal/phaser/core/world'
|
@@ -33,16 +33,17 @@ module Phaser
|
|
33
33
|
}
|
34
34
|
end
|
35
35
|
|
36
|
-
alias_native :cache,
|
37
|
-
alias_native :add,
|
36
|
+
alias_native :cache, :cache, as: Cache
|
37
|
+
alias_native :add, :add, as: GameObjectFactory
|
38
|
+
alias_native :world, :world, as: World
|
39
|
+
alias_native :physics, :physics, as: Physics
|
40
|
+
alias_native :input, :input, as: Input
|
41
|
+
alias_native :time, :time, as: Time
|
42
|
+
alias_native :rnd, :rnd, as: RandomDataGenerator
|
38
43
|
|
39
44
|
alias_native :load
|
40
|
-
alias_native :world, :world, as: World
|
41
45
|
alias_native :stage
|
42
|
-
alias_native :physics, :physics, as: Physics
|
43
46
|
alias_native :debug
|
44
|
-
alias_native :input, :input, as: Input
|
45
47
|
alias_native :width
|
46
|
-
alias_native :time
|
47
48
|
end
|
48
49
|
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# These requires must be loaded in order of dependency:
|
2
|
+
require 'opal/phaser/game_objects/events'
|
3
|
+
require 'opal/phaser/game_objects/sprite'
|
4
|
+
require 'opal/phaser/game_objects/tile_sprite'
|
5
|
+
require 'opal/phaser/game_objects/text'
|
6
|
+
require 'opal/phaser/game_objects/image'
|
7
|
+
require 'opal/phaser/game_objects/game_object_factory'
|
@@ -2,11 +2,11 @@ module Phaser
|
|
2
2
|
class GameObjectFactory
|
3
3
|
include Native
|
4
4
|
|
5
|
-
alias_native :sprite,
|
6
|
-
alias_native :group,
|
7
|
-
alias_native :text,
|
8
|
-
alias_native :image,
|
9
|
-
alias_native :tween,
|
10
|
-
alias_native :tile_sprite, :tileSprite
|
5
|
+
alias_native :sprite, :sprite, as: Sprite
|
6
|
+
alias_native :group, :group, as: Group
|
7
|
+
alias_native :text, :text, as: Text
|
8
|
+
alias_native :image, :image, as: Image
|
9
|
+
alias_native :tween, :tween, as: Tween
|
10
|
+
alias_native :tile_sprite, :tileSprite, as: TileSprite
|
11
11
|
end
|
12
12
|
end
|
@@ -3,7 +3,6 @@ module Phaser
|
|
3
3
|
include Native
|
4
4
|
|
5
5
|
alias_native :scale
|
6
|
-
alias_native :body
|
7
6
|
alias_native :bounce
|
8
7
|
|
9
8
|
alias_native :kill
|
@@ -35,8 +34,9 @@ module Phaser
|
|
35
34
|
|
36
35
|
alias_native :load_texture, :loadTexture
|
37
36
|
|
37
|
+
alias_native :body, :body, as: Physics::Arcade::Body
|
38
38
|
alias_native :anchor, :anchor, as: Anchor
|
39
39
|
alias_native :animations, :animations, as: AnimationManager
|
40
|
-
alias_native :events,
|
40
|
+
alias_native :events, :events, as: Events
|
41
41
|
end
|
42
42
|
end
|
@@ -2,6 +2,15 @@ module Phaser
|
|
2
2
|
class Keyboard
|
3
3
|
include Native
|
4
4
|
|
5
|
+
SPACEBAR = `Phaser.Keyboard.SPACEBAR`
|
6
|
+
LEFT = `Phaser.Keyboard.LEFT`
|
7
|
+
RIGHT = `Phaser.Keyboard.RIGHT`
|
8
|
+
A = `Phaser.Keyboard.A`
|
9
|
+
D = `Phaser.Keyboard.D`
|
10
|
+
|
5
11
|
alias_native :create_cursor_keys, :createCursorKeys
|
12
|
+
alias_native :remove_key, :removeKey
|
13
|
+
|
14
|
+
alias_native :add_key, :addKey, as: Key
|
6
15
|
end
|
7
16
|
end
|
@@ -13,6 +13,21 @@ module Phaser
|
|
13
13
|
alias_native :check_collision, :checkCollision
|
14
14
|
|
15
15
|
class Body
|
16
|
+
include Native
|
17
|
+
|
18
|
+
alias_native :gravity
|
19
|
+
alias_native :velocity
|
20
|
+
alias_native :bounce
|
21
|
+
alias_native :touching
|
22
|
+
alias_native :set_size, :setSize
|
23
|
+
|
24
|
+
def collide_world_bounds=(bool)
|
25
|
+
`#@native.collideWorldBounds = bool`
|
26
|
+
end
|
27
|
+
|
28
|
+
def immovable=(bool)
|
29
|
+
`#@native.immovable = bool`
|
30
|
+
end
|
16
31
|
end
|
17
32
|
end
|
18
33
|
|
data/lib/opal/phaser/setup.rb
CHANGED
@@ -1,31 +1,16 @@
|
|
1
|
+
# We need the Opal Native support library here:
|
1
2
|
require 'native'
|
2
3
|
|
3
|
-
|
4
4
|
# These requires must be loaded in order of dependency:
|
5
|
-
require 'opal/phaser/core/
|
6
|
-
require 'opal/phaser/
|
7
|
-
require 'opal/phaser/
|
8
|
-
require 'opal/phaser/
|
9
|
-
require 'opal/phaser/
|
10
|
-
|
11
|
-
require 'opal/phaser/
|
12
|
-
require 'opal/phaser/
|
13
|
-
require 'opal/phaser/
|
14
|
-
|
15
|
-
require
|
16
|
-
|
17
|
-
require 'opal/phaser/game_objects/events'
|
18
|
-
require 'opal/phaser/game_objects/sprite'
|
19
|
-
require 'opal/phaser/game_objects/text'
|
20
|
-
require 'opal/phaser/game_objects/image'
|
21
|
-
require 'opal/phaser/game_objects/game_object_factory'
|
22
|
-
|
23
|
-
require 'opal/phaser/input/keyboard'
|
24
|
-
require 'opal/phaser/input/input'
|
25
|
-
|
26
|
-
require 'opal/phaser/loader/cache'
|
27
|
-
|
28
|
-
require 'opal/phaser/physics/physics'
|
29
|
-
|
30
|
-
|
5
|
+
require 'opal/phaser/core/files'
|
6
|
+
require 'opal/phaser/animation/files'
|
7
|
+
require 'opal/phaser/tween/files'
|
8
|
+
require 'opal/phaser/physics/files'
|
9
|
+
require 'opal/phaser/game_objects/files'
|
10
|
+
require 'opal/phaser/input/files'
|
11
|
+
require 'opal/phaser/loader/files'
|
12
|
+
require 'opal/phaser/time/files'
|
13
|
+
require 'opal/phaser/math/files'
|
14
|
+
|
15
|
+
# TODO: This is odd here as it doesn't fit the files.rb require pattern... how can we clean this up?
|
31
16
|
require 'opal/phaser/core/game'
|
data/lib/opal/phaser/version.rb
CHANGED
data/opal-phaser.gemspec
CHANGED
@@ -15,7 +15,6 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
16
|
s.require_paths = ['lib']
|
17
17
|
|
18
|
-
s.add_runtime_dependency 'opal'
|
19
|
-
s.add_development_dependency 'yard'
|
18
|
+
s.add_runtime_dependency 'opal'
|
20
19
|
s.add_development_dependency 'rake'
|
21
20
|
end
|
metadata
CHANGED
@@ -1,37 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-phaser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George Plymale
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.6.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.6.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: yard
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
30
16
|
requirements:
|
31
17
|
- - ">="
|
32
18
|
- !ruby/object:Gem::Version
|
33
19
|
version: '0'
|
34
|
-
type: :
|
20
|
+
type: :runtime
|
35
21
|
prerelease: false
|
36
22
|
version_requirements: !ruby/object:Gem::Requirement
|
37
23
|
requirements:
|
@@ -64,7 +50,6 @@ files:
|
|
64
50
|
- Rakefile
|
65
51
|
- common/images/logo.png
|
66
52
|
- demo/Gemfile
|
67
|
-
- demo/Gemfile.lock
|
68
53
|
- demo/README.md
|
69
54
|
- demo/app/main.rb
|
70
55
|
- demo/assets/baddie.png
|
@@ -81,23 +66,38 @@ files:
|
|
81
66
|
- lib/opal/phaser.rb
|
82
67
|
- lib/opal/phaser/animation/animation.rb
|
83
68
|
- lib/opal/phaser/animation/animation_manager.rb
|
69
|
+
- lib/opal/phaser/animation/files.rb
|
84
70
|
- lib/opal/phaser/animation/frame.rb
|
85
71
|
- lib/opal/phaser/core/anchor.rb
|
72
|
+
- lib/opal/phaser/core/files.rb
|
86
73
|
- lib/opal/phaser/core/game.rb
|
87
74
|
- lib/opal/phaser/core/group.rb
|
88
75
|
- lib/opal/phaser/core/signal.rb
|
89
76
|
- lib/opal/phaser/core/state.rb
|
90
77
|
- lib/opal/phaser/core/world.rb
|
91
78
|
- lib/opal/phaser/game_objects/events.rb
|
79
|
+
- lib/opal/phaser/game_objects/files.rb
|
92
80
|
- lib/opal/phaser/game_objects/game_object_factory.rb
|
93
81
|
- lib/opal/phaser/game_objects/image.rb
|
94
82
|
- lib/opal/phaser/game_objects/sprite.rb
|
95
83
|
- lib/opal/phaser/game_objects/text.rb
|
84
|
+
- lib/opal/phaser/game_objects/tile_sprite.rb
|
85
|
+
- lib/opal/phaser/input/files.rb
|
96
86
|
- lib/opal/phaser/input/input.rb
|
87
|
+
- lib/opal/phaser/input/key.rb
|
97
88
|
- lib/opal/phaser/input/keyboard.rb
|
98
89
|
- lib/opal/phaser/loader/cache.rb
|
90
|
+
- lib/opal/phaser/loader/files.rb
|
91
|
+
- lib/opal/phaser/math/files.rb
|
92
|
+
- lib/opal/phaser/math/random_data_generator.rb
|
93
|
+
- lib/opal/phaser/physics/files.rb
|
99
94
|
- lib/opal/phaser/physics/physics.rb
|
100
95
|
- lib/opal/phaser/setup.rb
|
96
|
+
- lib/opal/phaser/time/files.rb
|
97
|
+
- lib/opal/phaser/time/time.rb
|
98
|
+
- lib/opal/phaser/time/timer.rb
|
99
|
+
- lib/opal/phaser/time/timer_event.rb
|
100
|
+
- lib/opal/phaser/tween/files.rb
|
101
101
|
- lib/opal/phaser/tween/tween.rb
|
102
102
|
- lib/opal/phaser/version.rb
|
103
103
|
- opal-phaser.gemspec
|