Skip to content

Commit 3cbb820

Browse files
committed
You can now load any binary file via the Loader: game.load.binary(key, url, callback) - the optional callback allows for post-load processing before entering the Cache.
1 parent 352749e commit 3cbb820

13 files changed

Lines changed: 1107 additions & 127 deletions

File tree

README.md

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ New features:
5959
* Added Device.silk for detecting a Kindle Fire and updated desktop OS check to exclude Kindles (thanks LuckieLordie)
6060
* TilemapLayers now have debug and debugAlpha values, this turns on the drawing of the collision edges (very handy for debugging, as the name implies!)
6161
* Tweens have a new event: onLoop.
62+
* You can now load any binary file via the Loader: game.load.binary(key, url, callback) - the optional callback allows for post-load processing before entering the Cache.
6263

6364

6465
New Examples:
@@ -132,6 +133,18 @@ Nice and easy :)
132133
![Tanks](http://www.photonstorm.com/wp-content/uploads/2013/10/phaser_tanks-640x480.png)
133134

134135

136+
CDNJS
137+
-----
138+
139+
Thanks to a community member Phaser is now available on [CDNJS](http://cdnjs.com). You can include the following in your html:
140+
141+
`http://cdnjs.cloudflare.com/ajax/libs/phaser/1.1.3/phaser.min.js`
142+
143+
Or if you prefer you can leave the protocol off, so it works via http and https:
144+
145+
`//cdnjs.cloudflare.com/ajax/libs/phaser/1.1.3/phaser.min.js`
146+
147+
135148
Requirements
136149
------------
137150

@@ -142,6 +155,24 @@ For developing with Phaser you can use either a plain-vanilla JavaScript approac
142155
Phaser is 321 KB minified and 72 KB gzipped.
143156

144157

158+
Learn By Example
159+
----------------
160+
161+
Phaser comes with an ever growing suite of Examples. Personally I feel that we learn better by looking at small refined code examples, so we created over 170 of them and create new ones to test every new feature added. Inside the `examples` folder you'll find the current set. If you write a particularly good example then please send it to us.
162+
163+
The examples need to be run through a local web server (in order to avoid file access permission errors from your browser). You can use your own web server, or start the included web server using grunt.
164+
165+
Using a locally installed web server browse to the examples folder:
166+
167+
examples/index.html
168+
169+
Alternatively in order to start the included web server, after you've cloned the repo, run `npm install` to install all dependencies, then `grunt connect `to start a local server. After running this command you should be able to access your local webserver at `http://127.0.0.1:8000`. Then browse to the examples folder: `http://127.0.0.1:8000/examples/index.html`
170+
171+
There is a new 'Side View' example viewer as well. This loads all the examples into a left-hand frame for faster navigation.
172+
173+
You can also browse all [Phaser Examples](http://gametest.mobi/phaser/) online.
174+
175+
145176
Features
146177
--------
147178

@@ -208,7 +239,7 @@ We use Phaser every day on our many client projects. As a result it's constantly
208239

209240
**Battle Tested**
210241

211-
Although Phaser 1.0 is a brand new release it is born from years of experience building some of the biggest HTML5 games out there. We're not saying it is 100% bug free, but we use it for our client work every day, so issues get resolved <em>fast</em> and we stay on-top of the changing browser landscape.
242+
Although Phaser 1.0 is a brand new release it is born from years of experience building some of the biggest mobile HTML5 games out there. We're not saying it is 100% bug free, but we use it for our client work every day, so issues get resolved <em>fast</em> and we stay on-top of the changing browser landscape.
212243

213244
![FruitParty](http://www.photonstorm.com/wp-content/uploads/2013/10/phaser_fruit_particles-640x480.png)
214245

@@ -218,14 +249,10 @@ Road Map
218249

219250
The 1.1 release was a massive under-taking, but we're really happy with how Phaser is progressing. It's becoming more solid and versatile with each iteration. Here is what's on our road map for future versions:
220251

221-
Version 1.1.4 ("Kandor")
222-
223-
* Enhance the State Management, so you can perform non-destructive State swaps and persistence.
224-
* More advanced tile map features. Better support for advanced Tiled features. Proper support for DAME tilemaps.
225-
226252
Versions 1.2 ("Saldaea")
227253

228254
* Integration with the p2.js physics system.
255+
* Enhance the State Management, so you can perform non-destructive State swaps and persistence.
229256

230257
Beyond version 1.2
231258

@@ -244,24 +271,7 @@ Beyond version 1.2
244271
* Add a d-pad example (http://www.html5gamedevs.com/topic/1574-gameinputondown-question/)
245272
* Create more touch input examples (http://www.html5gamedevs.com/topic/1556-mobile-touch-event/)
246273
* Look at HiDPI Canvas settings.
247-
248-
249-
Learn By Example
250-
----------------
251-
252-
Phaser comes with an ever growing suite of Examples. Personally I feel that we learn better by looking at small refined code examples, so we created over 170 of them and create new ones to test every new feature added. Inside the `examples` folder you'll find the current set. If you write a particularly good example then please send it to us.
253-
254-
The examples need to be run through a local web server (in order to avoid file access permission errors from your browser). You can use your own web server, or start the included web server using grunt.
255-
256-
Using a locally installed web server browse to the examples folder:
257-
258-
examples/index.html
259-
260-
Alternatively in order to start the included web server, after you've cloned the repo, run `npm install` to install all dependencies, then `grunt connect `to start a local server. After running this command you should be able to access your local webserver at `http://127.0.0.1:8000`. Then browse to the examples folder: `http://127.0.0.1:8000/examples/index.html`
261-
262-
There is a new 'Side View' example viewer as well. This loads all the examples into a left-hand frame for faster navigation.
263-
264-
You can also browse all [Phaser Examples](http://gametest.mobi/phaser/) online.
274+
* Support for parallel asset loading.
265275

266276

267277
Contributing
93.9 KB
Binary file not shown.
94.7 KB
Binary file not shown.
127 KB
Binary file not shown.
183 KB
Binary file not shown.
99.6 KB
Binary file not shown.
163 KB
Binary file not shown.
195 KB
Binary file not shown.
185 KB
Binary file not shown.

examples/wip/mod.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render });
3+
4+
function preload() {
5+
6+
game.load.script('pt', 'wip/pt.js');
7+
game.load.binary('impulse', 'assets/audio/protracker/act_of_impulse.mod', modLoaded, this);
8+
game.load.binary('macrocosm', 'assets/audio/protracker/macrocosm.mod', modLoaded, this);
9+
game.load.binary('enigma', 'assets/audio/protracker/enigma.mod', modLoaded, this);
10+
game.load.binary('elysium', 'assets/audio/protracker/elysium.mod', modLoaded, this);
11+
12+
}
13+
14+
function modLoaded(key, data) {
15+
16+
console.log('module loaded:', key);
17+
18+
var buffer = new Uint8Array(data);
19+
20+
return buffer;
21+
22+
}
23+
24+
var sprite;
25+
var modsample = new Array();
26+
var module;
27+
28+
function create() {
29+
30+
module = new Protracker();
31+
module.buffer = game.cache.getBinary('elysium');
32+
module.parse();
33+
module.play();
34+
35+
}
36+
37+
function update() {
38+
39+
if (module.channel[0].noteon) {sam1=module.channel[0].sample; modsamples=1;}else{modsamples=0;}
40+
if (module.channel[1].noteon) {sam2=module.channel[1].sample; modsamples=1;}else{modsamples=0;}
41+
if (module.channel[2].noteon) {sam3=module.channel[2].sample; modsamples=1;}else{modsamples=0;}
42+
if (module.channel[3].noteon) {sam4=module.channel[3].sample; modsamples=1;}else{modsamples=0;}
43+
44+
var posi=module.position;
45+
var patt=module.row;
46+
var bpm=module.bpm;
47+
var spd=module.speed;
48+
var modname=module.title;
49+
var modauth=module.signature;
50+
51+
}
52+
53+
function render() {
54+
55+
}

0 commit comments

Comments
 (0)