opal-phaser 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/demo/app/main.rb +3 -3
- data/lib/opal/phaser.rb +0 -1
- data/lib/opal/phaser/core.rb +1 -0
- data/lib/opal/phaser/core/game.rb +3 -0
- data/lib/opal/phaser/{physics.rb → core/physics.rb} +0 -0
- data/lib/opal/phaser/version.rb +1 -1
- metadata +3 -6
- data/demo/block.png +0 -0
- data/demo/main.js +0 -15
- data/demo/phaser.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0815d03446aaf12d64e17701fc4a1a0ab9ddda49
|
4
|
+
data.tar.gz: 6518fa60e436642621096f885edcdc42ff24782b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 656b0144cc26e3f91c58ce0b034277ae4ab1a92db3063a2abafed3c426fc68ec5ce1b79752da9226ac44c9b75a0a4a2a57380b32b9adb86393bcfc41e3adce8b
|
7
|
+
data.tar.gz: 5f77e66a7b496b45d3d8b083e760c6bc7129712c22bdb1be255b6f12e01c4fba5092d34f61df807ad75d7872b39c1cdb3bc03d469a7685ee2f36bc04cf78ce14
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<img align="right" width="250" src="https://raw.githubusercontent.com/orbitalimpact/opal-phaser/master/common/images/logo.png">
|
6
6
|
|
7
|
-
The goal of this project is to completely wrap the Phaser
|
7
|
+
The goal of this project is to completely wrap the Phaser API in Opal, to allow developers to write HTML5 and WebGL games entirely from Ruby code.
|
8
8
|
|
9
9
|
If you have not heard of Phaser, check out these links:
|
10
10
|
|
data/demo/app/main.rb
CHANGED
@@ -62,15 +62,15 @@ class Game
|
|
62
62
|
end
|
63
63
|
|
64
64
|
state.update do |game|
|
65
|
-
game.physics.arcade.collide(@player, @platforms)
|
66
|
-
game.physics.arcade.collide(@stars, @platforms)
|
65
|
+
game.physics.arcade.collide(@player, @platforms)
|
66
|
+
game.physics.arcade.collide(@stars, @platforms)
|
67
67
|
|
68
68
|
collectStar = proc do |player, star|
|
69
69
|
%x{ star.kill() }
|
70
70
|
@score += 10
|
71
71
|
@scoreText.text = "Score: #@score"
|
72
72
|
end
|
73
|
-
game.physics.arcade.overlap(@player, @stars, collectStar, nil, self)
|
73
|
+
game.physics.arcade.overlap(@player, @stars, collectStar, nil, self)
|
74
74
|
|
75
75
|
@player.body.velocity.x = 0
|
76
76
|
|
data/lib/opal/phaser.rb
CHANGED
data/lib/opal/phaser/core.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'native'
|
2
2
|
module Phaser
|
3
3
|
AUTO = %x{ Phaser.AUTO }
|
4
|
+
WEBGL = %x{ Phaser.WEBGL }
|
5
|
+
CANVAS = %x{ Phaser.CANVAS }
|
4
6
|
|
5
7
|
class Game
|
6
8
|
include ::Native
|
@@ -29,6 +31,7 @@ module Phaser
|
|
29
31
|
alias_native :add, :add
|
30
32
|
alias_native :world, :world
|
31
33
|
alias_native :physics, :physics
|
34
|
+
alias_native :debug, :debug
|
32
35
|
alias_native :input, :input
|
33
36
|
|
34
37
|
end
|
File without changes
|
data/lib/opal/phaser/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-phaser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George Plymale
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -73,18 +73,15 @@ files:
|
|
73
73
|
- demo/assets/platform.png
|
74
74
|
- demo/assets/sky.png
|
75
75
|
- demo/assets/star.png
|
76
|
-
- demo/block.png
|
77
76
|
- demo/config.ru
|
78
77
|
- demo/index.html
|
79
|
-
- demo/main.js
|
80
|
-
- demo/phaser.png
|
81
78
|
- demo/style.css
|
82
79
|
- lib/opal-phaser.rb
|
83
80
|
- lib/opal/phaser.rb
|
84
81
|
- lib/opal/phaser/core.rb
|
85
82
|
- lib/opal/phaser/core/game.rb
|
83
|
+
- lib/opal/phaser/core/physics.rb
|
86
84
|
- lib/opal/phaser/core/state.rb
|
87
|
-
- lib/opal/phaser/physics.rb
|
88
85
|
- lib/opal/phaser/version.rb
|
89
86
|
- opal-phaser.gemspec
|
90
87
|
homepage: http://github.com/orbitalimpact/opal-phaser
|
data/demo/block.png
DELETED
Binary file
|
data/demo/main.js
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
// This file is just a sanity check to see if this demo works in plain JS
|
2
|
-
|
3
|
-
function Game () {
|
4
|
-
this.game = new Phaser.Game(800, 600, Phaser.AUTO, "", { preload: preload, create: create });
|
5
|
-
|
6
|
-
function preload () {
|
7
|
-
this.game.load.image("logo", "phaser.png");
|
8
|
-
}
|
9
|
-
|
10
|
-
function create () {
|
11
|
-
this.logo = this.game.add.sprite(100, 100, "logo");
|
12
|
-
}
|
13
|
-
}
|
14
|
-
|
15
|
-
phaserGame = new Game();
|
data/demo/phaser.png
DELETED
Binary file
|