melonjs-generator 0.2 → 0.3
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.
- data/lib/USAGE +9 -0
- data/lib/generators/melonjs/templates/main.js.coffee +1 -13
- data/lib/melonjs_generator.rb +15 -0
- metadata +6 -4
data/lib/USAGE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Description:
|
|
2
|
+
Puts the minified melonjs library file in the vendor directory, and sets up the application.js file to load it properly.
|
|
3
|
+
|
|
4
|
+
Example:
|
|
5
|
+
rails generate melonjs
|
|
6
|
+
|
|
7
|
+
This will create:
|
|
8
|
+
- vendor/assets/javascripts/melonJS-0.9.4.js
|
|
9
|
+
- app/assets/javascripts/application.js
|
|
@@ -3,19 +3,7 @@ g_resources = []
|
|
|
3
3
|
|
|
4
4
|
jsApp = {
|
|
5
5
|
onload: ->
|
|
6
|
-
# replace the jsapp with the id of the div you wish to use for the container, and change the width/height
|
|
7
|
-
if !me.video.init("jsapp", 640, 480, false, 1.0)
|
|
8
|
-
alert "Sorry but your browser does not support html5 canvas."
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
me.loader.onload = this.loaded.bind(this)
|
|
12
|
-
me.loader.preload(g_resources)
|
|
13
|
-
|
|
14
|
-
me.state.change(me.state.LOADING)
|
|
15
|
-
|
|
16
6
|
loaded: ->
|
|
17
|
-
me.state.set(me.state.PLAY, new PlayScreen())
|
|
18
|
-
me.state.change(me.state.PLAY)
|
|
19
7
|
}
|
|
20
8
|
|
|
21
9
|
# the in game stuff
|
|
@@ -29,5 +17,5 @@ PlayScreen = me.ScreenObject.extend({
|
|
|
29
17
|
me.audio.stopTrack()
|
|
30
18
|
})
|
|
31
19
|
|
|
32
|
-
|
|
20
|
+
window.onReady ->
|
|
33
21
|
jsApp.onload();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class MelonjsGenerator < Rails::Generators::Base
|
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
|
3
|
+
|
|
4
|
+
def generate_melonjs_library
|
|
5
|
+
copy_file "melonJS-0.9.4.js", "vendor/assets/javascripts/melonJS-0.9.4.js"
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def generate_manifest
|
|
9
|
+
copy_file "application.js", "app/assets/javascripts/application.js"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def generate_base_files
|
|
13
|
+
copy_file "main.js.coffee", "app/assets/javascripts/main.js.coffee"
|
|
14
|
+
end
|
|
15
|
+
end
|
metadata
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: melonjs-generator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 13
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
|
-
-
|
|
9
|
-
version: "0.
|
|
8
|
+
- 3
|
|
9
|
+
version: "0.3"
|
|
10
10
|
platform: ruby
|
|
11
11
|
authors:
|
|
12
12
|
- Aaron McLeod
|
|
@@ -14,7 +14,7 @@ autorequire:
|
|
|
14
14
|
bindir: bin
|
|
15
15
|
cert_chain: []
|
|
16
16
|
|
|
17
|
-
date: 2012-
|
|
17
|
+
date: 2012-12-07 00:00:00 Z
|
|
18
18
|
dependencies:
|
|
19
19
|
- !ruby/object:Gem::Dependency
|
|
20
20
|
name: rails
|
|
@@ -47,6 +47,8 @@ files:
|
|
|
47
47
|
- lib/generators/melonjs/templates/main.js.coffee
|
|
48
48
|
- lib/generators/melonjs/templates/melonJS-0.9.4.js
|
|
49
49
|
- lib/generators/melonjs/USAGE
|
|
50
|
+
- lib/melonjs_generator.rb
|
|
51
|
+
- lib/USAGE
|
|
50
52
|
homepage: https://github.com/agmcleod/melonjs-generator
|
|
51
53
|
licenses: []
|
|
52
54
|
|