New filters and demos: LightBeams, Fire and Tunnel. Also Loader can now load script files.

This commit is contained in:
photonstorm
2013-11-28 05:43:35 +00:00
parent 39025c1c2a
commit 780b8a5d6d
22 changed files with 546 additions and 13 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 572 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 680 KiB

+1
View File
@@ -7,6 +7,7 @@ var filter;
function preload() {
game.load.image('phaser', 'assets/sprites/phaser2.png');
game.load.script('fire', '../filters/Fire.js');
}
+41
View File
@@ -0,0 +1,41 @@
var game = new Phaser.Game(800, 600, Phaser.WEBGL, 'phaser-example', { preload: preload, create: create, update: update });
var background;
var filter;
function preload() {
game.load.image('phaser', 'assets/sprites/phaser2.png');
game.load.script('light', '../filters/LightBeam.js');
}
function create() {
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
logo.anchor.setTo(0.5, 0.5);
background = game.add.sprite(0, 0);
background.width = 800;
background.height = 600;
filter = game.add.filter('LightBeam', 800, 600);
// You have the following values to play with (defaults shown):
filter.alpha = 0.0;
// filter.red = 1.0;
// filter.green = 1.0;
// filter.blue = 2.0;
// filter.thickness = 70.0;
// filter.speed = 1.0;
background.filters = [filter];
}
function update() {
filter.update();
}
+43
View File
@@ -0,0 +1,43 @@
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
var background;
var filter;
function preload() {
game.load.image('phaser', 'assets/sprites/phaser2.png');
game.load.script('plasma', '../filters/Plasma.js');
}
function create() {
background = game.add.sprite(0, 0);
background.width = 800;
background.height = 600;
filter = game.add.filter('Plasma', 800, 600);
// You have the following values to play with (defaults shown below):
// filter.size = 0.03;
// filter.redShift = 0.5;
// filter.greenShift = 0.5;
// filter.blueShift = 0.9;
background.filters = [filter];
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
logo.anchor.setTo(0.5, 0.5);
}
function update() {
filter.update();
// Uncomment for coolness :)
// filter.blueShift -= 0.001;
}
+40
View File
@@ -0,0 +1,40 @@
var game = new Phaser.Game(800, 600, Phaser.WEBGL, 'phaser-example', { preload: preload, create: create, update: update });
var background;
var filter;
function preload() {
game.load.image('phaser', 'assets/sprites/phaser.png');
game.load.image('texture', 'assets/textures/ooze.png');
game.load.script('tunnel', '../filters/Tunnel.js');
}
function create() {
background = game.add.sprite(0, 0, 'texture');
background.width = 800;
background.height = 600;
filter = game.add.filter('Tunnel', 800, 600, background.texture);
// You have the following value to play with (default value is 2.0):
filter.origin = 1.0;
background.filters = [filter];
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
logo.anchor.setTo(0.5, 0.5);
}
function update() {
filter.update();
// Uncomment for coolness :)
filter.origin = filter.origin + 0.001;
}
+1
View File
@@ -7,6 +7,7 @@ var filter;
function preload() {
game.load.image('phaser', 'assets/sprites/phaser2.png');
game.load.script('fire', '../filters/Fire.js');
}
-5
View File
@@ -85,11 +85,6 @@
$f = $_GET['f'];
?>
<script src="wip/<?php echo $f?>" type="text/javascript"></script>
<script src="../filters/SampleFilter.js" type="text/javascript"></script>
<script src="../filters/BinarySerpents.js" type="text/javascript"></script>
<script src="../filters/Tunnel.js" type="text/javascript"></script>
<script src="../filters/ColorBars.js" type="text/javascript"></script>
<script src="../filters/Fire.js" type="text/javascript"></script>
<?php
}
?>
+41
View File
@@ -0,0 +1,41 @@
var game = new Phaser.Game(800, 600, Phaser.WEBGL, 'phaser-example', { preload: preload, create: create, update: update });
var background;
var filter;
function preload() {
game.load.image('phaser', 'assets/sprites/phaser2.png');
game.load.script('light', '../filters/LightBeam.js');
}
function create() {
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
logo.anchor.setTo(0.5, 0.5);
background = game.add.sprite(0, 0);
background.width = 800;
background.height = 600;
filter = game.add.filter('LightBeam', 800, 600);
// You have the following values to play with (defaults shown):
filter.alpha = 0.0;
// filter.red = 1.0;
// filter.green = 1.0;
// filter.blue = 2.0;
// filter.thickness = 70.0;
// filter.speed = 1.0;
background.filters = [filter];
}
function update() {
filter.update();
}
+43
View File
@@ -0,0 +1,43 @@
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
var background;
var filter;
function preload() {
game.load.image('phaser', 'assets/sprites/phaser2.png');
game.load.script('fire', '../filters/Plasma.js');
}
function create() {
background = game.add.sprite(0, 0);
background.width = 800;
background.height = 600;
filter = game.add.filter('Plasma', 800, 600);
// You have the following values to play with (defaults shown below):
// filter.size = 0.03;
// filter.redShift = 0.5;
// filter.greenShift = 0.5;
// filter.blueShift = 0.9;
background.filters = [filter];
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
logo.anchor.setTo(0.5, 0.5);
}
function update() {
filter.update();
// Uncomment for coolness :)
// filter.blueShift -= 0.001;
}
+13 -7
View File
@@ -1,35 +1,41 @@
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });
var game = new Phaser.Game(800, 600, Phaser.WEBGL, 'phaser-example', { preload: preload, create: create, update: update });
var background;
var filter;
function preload() {
game.load.image('texture', 'wip/tex00.jpg');
game.load.image('sea', 'assets/pics/undersea.jpg');
game.load.image('phaser', 'assets/sprites/phaser.png');
game.load.image('texture2', 'wip/tex00.jpg');
game.load.image('texture', 'assets/textures/ooze.png');
game.load.script('tunnel', '../filters/Tunnel.js');
}
function create() {
game.add.sprite(0, 0, 'sea');
background = game.add.sprite(0, 0, 'texture');
background.width = 800;
background.height = 600;
filter = game.add.filter('Tunnel', 800, 600, background.texture);
// filter.alpha = 0.5;
// filter.origin = 0.5;
// You have the following value to play with (default value is 2.0):
filter.origin = 1.0;
background.filters = [filter];
var logo = game.add.sprite(game.world.centerX, game.world.centerY, 'phaser');
logo.anchor.setTo(0.5, 0.5);
}
function update() {
filter.update();
// Uncomment for coolness :)
filter.origin = filter.origin + 0.001;
}