igg 0.0.9 → 0.0.10
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/README.md +9 -1
- data/VERSION +1 -1
- data/bin/igg +1 -0
- data/lib/igg.rb +1 -0
- data/lib/igg/builder/project_builder.rb +1 -0
- data/lib/igg/builder/templates/project/levelexit.js +30 -0
- data/lib/igg/cli.rb +7 -4
- data/lib/igg/server.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c82d6732567b3748092762d82d620958a5ef192e
|
4
|
+
data.tar.gz: 7125d2ea93471ece838d9290d97be78a644d83b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 385a5787e730c7dabb2e5b6753688277610aa5b43c4db851fdcfc08aebd496d906883dff7b172ab6566376f4eb4641b2726f7f047637c0b8ff1bce9959a2b5bd
|
7
|
+
data.tar.gz: 3fa2e1edc10f09ffb0c830cbe07f2db0da519aa646444eda418e2cde40b3e363e3ae65c183190c1839e22d62565504ecfdb1bc13247033142504393e0a324ac0
|
data/README.md
CHANGED
@@ -2,9 +2,17 @@
|
|
2
2
|
|
3
3
|
Several tools for fast developing an ImpactJS Game, include generators and built-in server to run the game and weltmeister level editor right in the current project folder without requiring apache http server and PHP configuration.
|
4
4
|
|
5
|
+
### Features
|
6
|
+
|
7
|
+
1: generators
|
8
|
+
a: create ImpactJS game project skeloton, containing toggleDebug button in index.html
|
9
|
+
b: create ImpactJS level snippet
|
10
|
+
c: create ImpactJS entity snippet
|
11
|
+
2: built-in http server to boot playing game and weltmeister level editor in current directory
|
12
|
+
|
5
13
|
### Requirement
|
6
14
|
|
7
|
-
1: Ruby 1.
|
15
|
+
1: Ruby 1.8.7 or later (tested)
|
8
16
|
2: ImpactJS (buy your license 99$)
|
9
17
|
|
10
18
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.10
|
data/bin/igg
CHANGED
data/lib/igg.rb
CHANGED
@@ -23,6 +23,7 @@ module Igg
|
|
23
23
|
copy_file 'builder/templates/project/toggleDebug.js',"#{@name}/js/toggleDebug.js"
|
24
24
|
|
25
25
|
copy_file 'builder/templates/project/04b03.font.png',"#{@name}/media/04b03.font.png"
|
26
|
+
copy_file 'builder/templates/project/levelexit.js', "#{@name}/lib/game/entities/levelexit.js"
|
26
27
|
template 'builder/templates/project/main.tt', "#{@name}/lib/game/main.js"
|
27
28
|
template 'builder/templates/level/main.js', "#{@name}/lib/game/levels/main.js"
|
28
29
|
template 'builder/templates/project/index.html', "#{@name}/index.html"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
ig.module(
|
2
|
+
'game.entities.levelexit'
|
3
|
+
)
|
4
|
+
.requires(
|
5
|
+
'impact.entity'
|
6
|
+
)
|
7
|
+
.defines(function(){
|
8
|
+
|
9
|
+
EntityLevelexit = ig.Entity.extend({
|
10
|
+
_wmDrawBox: true,
|
11
|
+
_wmBoxColor: 'rgba(0, 0, 255, 0.7)',
|
12
|
+
size: {x: 8, y: 8},
|
13
|
+
level: null,
|
14
|
+
checkAgainst: ig.Entity.TYPE.A,
|
15
|
+
update: function(){},
|
16
|
+
check: function(other) {
|
17
|
+
if (other instanceof EntityPlayer) {
|
18
|
+
ig.game.toggleStats(this);
|
19
|
+
}
|
20
|
+
},
|
21
|
+
nextLevel: function(){
|
22
|
+
if (this.level) {
|
23
|
+
var levelName = this.level.replace(/^(Level)?(\w)(\w*)/, function(m, l, a, b) {
|
24
|
+
return a.toUpperCase() + b;
|
25
|
+
});
|
26
|
+
ig.game.loadLevelDeferred(ig.global['Level' + levelName]);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
});
|
30
|
+
});
|
data/lib/igg/cli.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
+
require 'rubygems'
|
1
2
|
require 'sinatra'
|
2
3
|
require 'sinatra/base'
|
3
4
|
require 'pathname'
|
4
5
|
require 'json'
|
5
6
|
require 'thor'
|
6
|
-
require_relative 'server'
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
require File.join(File.dirname(__FILE__), 'server')
|
9
|
+
require File.join(File.dirname(__FILE__), 'ext/string_extention')
|
10
|
+
%w[project entity level].each { |task| require File.join(File.dirname(__FILE__), "builder/#{task}_builder") }
|
10
11
|
|
11
12
|
LIBDIR = File.expand_path(File.join(File.dirname(__FILE__), '../..', 'lib'))
|
12
13
|
ROOTDIR = File.expand_path(File.join(File.dirname(__FILE__), '../..'))
|
@@ -45,7 +46,9 @@ class Igg::CLI < Thor
|
|
45
46
|
@version = File.open("#{ROOTDIR}/VERSION", "rb").read
|
46
47
|
if method == 'server' then
|
47
48
|
if File.exist?('lib/weltmeister/config.js')
|
48
|
-
|
49
|
+
filename = "lib/weltmeister/config.js"
|
50
|
+
o = File.read(filename) .gsub(".php", "")
|
51
|
+
File.open(filename, "w") { |file| file << o }
|
49
52
|
puts
|
50
53
|
puts "*" * 80
|
51
54
|
puts "Igg Server #{@version} Eiffel Q(eiffelqiu@qq.com)"
|
data/lib/igg/server.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: igg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- eiffel qiu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: json
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.8'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.8'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: thor
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,6 +148,7 @@ files:
|
|
134
148
|
- lib/igg/builder/templates/project/index.html
|
135
149
|
- lib/igg/builder/templates/project/jquery.min.js
|
136
150
|
- lib/igg/builder/templates/project/level.js
|
151
|
+
- lib/igg/builder/templates/project/levelexit.js
|
137
152
|
- lib/igg/builder/templates/project/main.tt
|
138
153
|
- lib/igg/builder/templates/project/mobile.html
|
139
154
|
- lib/igg/builder/templates/project/sounds/death.mp3
|