Updating examples with new runner and menu system.

This commit is contained in:
Richard Davey
2013-09-13 17:48:47 +01:00
parent ad0d32b7aa
commit 70233b7508
155 changed files with 2377 additions and 104 deletions
-39
View File
@@ -1,39 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('atari1', 'assets/sprites/atari130xe.png');
}
function create() {
// var tempSprite = game.add.sprite(game.world.randomX, game.world.randomY, 'atari1');
}
function update() {
}
function render() {
}
})();
</script>
</body>
</html>
-57
View File
@@ -1,57 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('ship', 'assets/sprites/mana_card.png');
}
var player;
var aliens;
function create() {
player = game.add.sprite(400, 300, 'ship');
player.alpha = 0.2;
player.body.collideWorldBounds = true;
player.body.bounce.setTo(1, 1);
// The body offset is from the ANCHOR point of the Sprite, not the top-left (or center, etc)
player.body.setSize(60, 60, 0, 0);
player.anchor.setTo(0.5, 0.5);
player.body.velocity.x = 100;
}
function update() {
// console.log(Math.floor(player.center.x), Math.floor(player.center.y));
player.angle++;
player.scale.x += 0.005;
player.scale.y += 0.005;
}
function render() {
// game.debug.renderSpriteCorners(player,true,true);
game.debug.renderRectangle(player.body);
game.debug.renderPixel(400, 300, 'rgb(255,0,0)');
game.debug.renderPoint(player.center, 'rgb(255,254,0)');
}
})();
</script>
</body>
</html>
@@ -1,13 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Playing an audio file";
require('../head.php');
?>
<script type="text/javascript">
@@ -67,5 +61,6 @@
</script>
</body>
</html>
<?php
require('../foot.php');
?>
-39
View File
@@ -1,39 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.bitmapFont('desyrel', 'assets/fonts/desyrel.png', 'assets/fonts/desyrel.xml');
}
function create() {
game.add.bitmapText(200, 100, 'Phaser\nis rocking!', { font: '64px Desyrel', align: 'center' });
}
function update() {
}
function render() {
}
})();
</script>
</body>
</html>
-62
View File
@@ -1,62 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.atlasJSONHash('bot', 'assets/sprites/running_bot.png', 'assets/sprites/running_bot.json');
game.load.image('bunny', 'assets/sprites/bunny.png');
}
var bunny;
var bot;
function create() {
game.world._stage.backgroundColorString = '#182d3b';
bunny = game.add.sprite(500, game.world.centerY, 'bunny');
bunny.anchor.setTo(0.5, 0.5);
bot = game.add.sprite(150, game.world.centerY, 'bot');
bot.anchor.setTo(0.5, 0.5);
bot.animations.add('run');
bot.animations.play('run', 10, true);
game.add.tween(bot.scale).to({ x: 3, y: 3 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true);
}
function update() {
bunny.angle += 1;
bot.angle += 1;
}
function render() {
game.debug.renderSpriteCorners(bunny, true, true);
game.debug.renderSpriteCorners(bot, true, true);
game.debug.renderSpriteInfo(bunny, 20, 32);
game.debug.renderSpriteInfo(bot, 20, 132);
}
})();
</script>
</body>
</html>
-63
View File
@@ -1,63 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.atlasJSONHash('bot', 'assets/sprites/running_bot.png', 'assets/sprites/running_bot.json');
game.load.image('bunny', 'assets/sprites/mana_card.png');
}
var bunny;
var bot;
function create() {
game.world._stage.backgroundColorString = '#182d3b';
bunny = game.add.sprite(500, game.world.centerY, 'bunny');
bunny.body.offset.setTo();
bot = game.add.sprite(150, game.world.centerY, 'bot');
bot.anchor.setTo(0.5, 0.5);
bot.animations.add('run');
bot.animations.play('run', 10, true);
game.add.tween(bot.scale).to({ x: 3, y: 3 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true);
}
function update() {
bunny.angle += 1;
bot.angle += 1;
}
function render() {
game.debug.renderSpriteCorners(bunny, true, true);
game.debug.renderSpriteCorners(bot, true, true);
game.debug.renderRectangle(bunny.body.hitArea);
}
})();
</script>
</body>
</html>
-69
View File
@@ -1,69 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.atlasJSONHash('bot', 'assets/sprites/running_bot.png', 'assets/sprites/running_bot.json');
game.load.image('bunny', 'assets/sprites/mana_card.png');
}
var bunny;
var wall;
var bot;
function create() {
game.world._stage.backgroundColorString = '#182d3b';
// game.physics.gravity.y = 10;
bunny = game.add.sprite(200, 100, 'bunny');
bunny.body.bounce.y = 0.5;
// bunny.body.gravity.y = -10;
// bunny.body.setSize(20, 100);
// bunny.body.offset.setTo(25, -20);
// bunny.anchor.setTo(0.5, 0.5);
wall = game.add.sprite(200, 450, 'bunny');
wall.body.immovable = true;
wall.body.allowGravity = false;
// bunny.body.angularVelocity = 1;
bunny.body.velocity.x = 30;
// bunny.body.velocity.y = 120;
// bunny.body.velocity.y = 50;
}
function update() {
// bunny.rotation += 0.01;
game.physics.separate(bunny.body, wall.body);
}
function render() {
game.debug.renderSpriteCorners(bunny, true, true);
game.debug.renderRectangle(bunny.body);
game.debug.renderRectangle(wall.body);
}
})();
</script>
</body>
</html>
-341
View File
@@ -1,341 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('sonic', 'assets/sprites/sonic_havok_sanity.png');
game.load.image('carrot', 'assets/sprites/carrot.png');
}
var s;
var a;
var b;
var c;
var d;
var e;
var f;
var g;
var h;
var i;
var tests;
function create() {
s = game.add.sprite(600, 100, 'sonic');
s.name = 'X';
a = game.add.child(s, -70, 200, 'sonic');
b = game.add.child(s, -140, 200, 'sonic');
c = game.add.child(s, -210, 200, 'sonic');
d = game.add.child(s, -280, 200, 'sonic');
e = game.add.child(s, -350, 200, 'sonic');
f = game.add.child(s, -420, 200, 'sonic');
g = game.add.child(f, -50, 0, 'carrot');
h = game.add.child(f, -80, 0, 'carrot');
i = game.add.child(f, -110, 0, 'carrot');
a.name = 'A';
b.name = 'B';
c.name = 'C';
d.name = 'D';
e.name = 'E';
f.name = 'F';
g.name = 'g';
h.name = 'h';
i.name = 'i';
tests = [a,b,c,d,e,f,g,h,i];
game.input.onUp.add(runChange, this);
scanList(game.world._stage);
}
function runChange () {
changeOrder(a, h);
}
function changeOrder (node1, node2) {
if (node1 === node2 || !node1.parent || !node2.parent)
{
console.warn("You cannot swap a node with itself or swap un-parented nodes");
return;
}
console.log('Changing order of', node1.name,'and',node2.name);
// var index1 = s.children.indexOf(node1);
// var index2 = s.children.indexOf(node2);
// if (index1 !== -1 && index2 !== -1)
// {
// Cache the node values
var node1Prev = node1._iPrev;
var node1Next = node1._iNext;
var node2Prev = node2._iPrev;
var node2Next = node2._iNext;
// Now deep scan search and replace
var currentNode = game.world._stage;
var endNode = currentNode.last._iNext;
currentNode = currentNode.first;
do
{
if (currentNode !== node1 && currentNode !== node2)
{
if (currentNode.first === node1)
{
currentNode.first = node2;
}
else if (currentNode.first === node2)
{
currentNode.first = node1;
}
if (currentNode.last === node1)
{
currentNode.last = node2;
}
else if (currentNode.last === node2)
{
currentNode.last = node1;
}
}
currentNode = currentNode._iNext;
}
while (currentNode != endNode)
// Check for neighbours (cater for any order parameters)
if (node1._iNext == node2)
{
console.log('A-B neighbour swap');
// Starting
// Node 1 (A) Node 2 (B) X C
// Next: B Next: C Next: A Next: D
// Prev: X Prev: A Prev: - Prev: B
// Ending
// Node 1 (A) Node 2 (B) X C
// Next: C Next: A Next: B Next: D
// Prev: B Prev: X Prev: - Prev: A
node1._iNext = node2Next;
node1._iPrev = node2;
node2._iNext = node1;
node2._iPrev = node1Prev;
// Notify the head and tail
if (node1Prev)
{
node1Prev._iNext = node2;
}
if (node2Next)
{
node2Next._iPrev = node1;
}
}
else if (node2._iNext == node1)
{
console.log('B-A neighbour swap');
// Starting
// Node 1 (B) Node 2 (A) X C
// Next: C Next: B Next: A Next: D
// Prev: A Prev: X Prev: - Prev: B
// Ending
// Node 1 (B) Node 2 (A) X C
// Next: A Next: C Next: B Next: D
// Prev: X Prev: B Prev: - Prev: A
node1._iNext = node2;
node1._iPrev = node2Prev;
node2._iNext = node1Next;
node2._iPrev = node1;
// Notify the head and tail
if (node2Prev)
{
node2Prev._iNext = node1;
}
if (node1Next)
{
node2Next._iPrev = node2;
}
}
else
{
// Nodes are far apart
console.log('Nodes are far apart');
// Pre-swap:
// X next: a prev: - first: X last: d
// a next: b prev: X first: a last: a
// b next: c prev: a first: b last: b
// c next: d prev: b first: c last: c
// d next: e prev: c first: d last: d
// e next: f prev: d first: e last: e
// f next: - prev: e first: f last: f
// Post-swap:
// X next: d prev: - first: X last: d ***
// d next: b prev: X first: d last: d ***
// b next: c prev: d first: b last: b ***
// c next: a prev: b first: c last: c ***
// a next: e prev: c first: a last: a ***
// e next: f prev: a first: e last: e ***
// f next: - prev: e first: f last: f
// Starting
// Node 1 (A) Node 2 (D) N1 Prev (X) N1 Next (B) N2 Prev (C) N2 Next (E)
// Next: B Next: E Next: A Next: C Next: D Next: F
// Prev: X Prev: C Prev: - Prev: A Prev: B Prev: D
// Ending
// Node 1 (A) Node 2 (D) N1 Prev (X) N1 Next (B) N2 Prev (C) N2 Next (E)
// Next: E Next: B Next: D Next: C Next: A Next: F
// Prev: C Prev: X Prev: - Prev: D Prev: B Prev: A
// Simple node 1-2 swap
node1._iNext = node2Next;
node1._iPrev = node2Prev;
node2._iNext = node1Next;
node2._iPrev = node1Prev;
// Now the head and tail for node 1.
if (node1Prev)
{
node1Prev._iNext = node2;
}
if (node1Next)
{
node1Next._iPrev = node2;
}
// Now the head and tail for node 2.
if (node2Prev)
{
node2Prev._iNext = node1;
}
if (node2Next)
{
node2Next._iPrev = node1;
}
}
// }
scanList(game.world._stage);
}
function scanList (sprite) {
console.log('Node | Next | Prev | First | Last');
console.log('------|--------|--------|---------|---------');
var displayObject = sprite;
var testObject = displayObject.last._iNext;
displayObject = displayObject.first;
do
{
var name = displayObject.name || '~';
var nameNext = '-';
var namePrev = '-';
var nameFirst = '-';
var nameLast = '-';
if (displayObject._iNext)
{
nameNext = displayObject._iNext.name;
}
if (displayObject._iPrev)
{
namePrev = displayObject._iPrev.name;
}
if (displayObject.first)
{
nameFirst = displayObject.first.name;
}
if (displayObject.last)
{
nameLast = displayObject.last.name;
}
if (typeof nameNext === 'undefined')
{
nameNext = '-';
}
if (typeof namePrev === 'undefined')
{
namePrev = '-';
}
if (typeof nameFirst === 'undefined')
{
nameFirst = '-';
}
if (typeof nameLast === 'undefined')
{
nameLast = '-';
}
console.log(name + ' | ' + nameNext + ' | ' + namePrev + ' | ' + nameFirst + ' | ' + nameLast);
displayObject = displayObject._iNext;
}
while(displayObject != testObject)
}
function update() {
}
function render() {
for (var i = 0; i < tests.length; i++)
{
game.debug.renderText(tests[i].name, s.x + tests[i].x, s.y + tests[i].y - 20);
}
// game.debug.renderSpriteCorners(s, false, false);
game.debug.renderSpriteInfo(a, 20, 32);
}
})();
</script>
</body>
</html>
-41
View File
@@ -1,41 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('card', 'assets/sprites/mana_card.png');
}
function create() {
game.add.sprite(game.world.randomX, game.world.randomY, 'card');
}
function runChange () {
// changeOrder(a, h);
}
function update() {
}
function render() {
}
})();
</script>
</body>
</html>
-94
View File
@@ -1,94 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create });
function preload() {
game.load.image('sonic', 'assets/sprites/sonic_havok_sanity.png');
game.load.image('card', 'assets/sprites/mana_card.png');
}
var group;
var s;
var a;
var b;
var c;
var d;
var e;
var f;
var g;
var h;
var i;
var group2;
var a2;
var b2;
var c2;
function create() {
group = game.add.group(null, 'group1');
a = group.create(70, 200, 'sonic');
b = group.create(140, 200, 'sonic');
c = group.create(210, 200, 'sonic');
d = group.create(280, 200, 'sonic');
e = group.create(350, 200, 'sonic');
f = group.create(420, 200, 'sonic');
g = group.create(50, 300, 'sonic');
h = group.create(80, 300, 'sonic');
i = group.create(110, 300, 'sonic');
a.name = 'A';
b.name = 'B';
c.name = 'C';
d.name = 'D';
e.name = 'E';
f.name = 'F';
g.name = 'g';
h.name = 'h';
i.name = 'i';
/*
group2 = game.add.group(group, 'group2');
a2 = group2.create(500, 200, 'card');
b2 = group2.create(550, 200, 'card');
c2 = group2.create(600, 200, 'card');
a2.name = 'A2';
b2.name = 'B2';
c2.name = 'C2';
*/
// console.log(group2._container.parent);
group.dump(true);
game.input.onUp.add(runChange, this);
}
function runChange () {
group.swap(a, i);
group.dump(true);
}
})();
</script>
</body>
</html>
-67
View File
@@ -1,67 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, render: render });
function preload() {
game.load.image('beast', 'assets/pics/shadow_of_the_beast2_karamoon.png');
game.load.spritesheet('button', 'assets/buttons/button_sprite_sheet.png', 193, 71);
}
var image;
var button;
function create() {
game.stage.backgroundColor = 0xefefef;
// This is just an image that we'll toggle the display of when you click the button
image = game.add.sprite(game.world.centerX, 0, 'beast');
image.anchor.setTo(0.5, 0);
// This button is created from a sprite sheet.
// Frame 0 = the 'down' state
// Frame 1 = the 'out' state
// Frame 2 = the 'over' state
// The function "clickedIt" will be called when the button is clicked or touched
button = game.add.button(game.world.centerX, 400, 'button', clickedIt, this, 2, 1, 0);
// Just makes the button anchor set to the middle, we only do this to center the button on-screen, no other reason
button.anchor.setTo(0.5, 0.5);
}
function clickedIt() {
if (image.visible == true)
{
image.visible = false;
}
else
{
image.visible = true;
}
}
function render() {
}
})();
</script>
</body>
</html>
-72
View File
@@ -1,72 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });
function preload() {
game.load.image('mushroom', 'assets/sprites/mushroom2.png');
}
function create() {
// Make our game world 2000x2000 pixels in size (the default is to match the game size)
game.world.setSize(2000, 2000);
for (var i = 0; i < 50; i++)
{
var s = game.add.sprite(game.world.randomX, game.world.randomY, 'mushroom');
s.scrollFactor.setTo(0.5, 0.5);
}
for (var i = 0; i < 50; i++)
{
game.add.sprite(game.world.randomX, game.world.randomY, 'mushroom');
}
for (var i = 0; i < 50; i++)
{
var s = game.add.sprite(game.world.randomX, game.world.randomY, 'mushroom');
s.scrollFactor.setTo(2, 2);
}
}
function update() {
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT))
{
game.camera.x -= 4;
}
else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT))
{
game.camera.x += 4;
}
if (game.input.keyboard.isDown(Phaser.Keyboard.UP))
{
game.camera.y -= 4;
}
else if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN))
{
game.camera.y += 4;
}
}
})();
</script>
</body>
</html>
-175
View File
@@ -1,175 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('mushroom', 'assets/sprites/mana_card.png');
}
var s;
var c;
var r;
var p;
var tl;
var tr;
var bl;
var br;
var half = { width: 0, height: 0 };
var angle = 0;
var distance = 0;
/**
* Returns an array containing 4 Point objects corresponding to the 4 corners of the sprite bounds.
* @method getAsPoints
* @param {Sprite} sprite The Sprite that will have its cameraView property modified
* @return {Array} An array of Point objects.
*/
function getAsPoints(sprite) {
var out = [];
// top left
out.push(new Phaser.Point(sprite.x, sprite.y));
// top right
out.push(new Phaser.Point(sprite.x + sprite.width, sprite.y));
// bottom right
out.push(new Phaser.Point(sprite.x + sprite.width, sprite.y + sprite.height));
// bottom left
out.push(new Phaser.Point(sprite.x, sprite.y + sprite.height));
return out;
}
var midpoint;
function create() {
// Make our game world 2000x2000 pixels in size (the default is to match the game size)
game.world.setSize(2000, 2000);
s = game.add.sprite(400, 300, 'mushroom');
midpoint = new Phaser.Point(s.x + s.width / 2, s.y + s.height / 2);
var points = getAsPoints(s);
tl = points[0];
tr = points[1];
br = points[2];
bl = points[3];
s.anchor.setTo(2, 0.5);
// PIXI worldTransform order:
// |a c tx|
// |b d ty|
// |0 0 1|
// 0 = scaleX (a)
// 1 = skewY (c)
// 2 = translateX
// 3 = skewX (b)
// 4 = scaleY (d)
// 5 = translateY
}
function update() {
s.angle += 0.5;
if (s.scale.x > -2)
{
s.scale.x -= 0.01;
s.scale.y -= 0.01;
}
}
function render() {
game.debug.renderSpriteInfo(s, 32, 32);
// var p1 = getLocalPosition(midpoint.x, midpoint.y, s);
var offsetX = s.anchor.x * s.width;
var offsetY = s.anchor.y * s.height;
var sx = s.x - offsetX;
var sy = s.y - offsetY;
// top left
var p1 = getLocalPosition(sx, sy, s);
// top right
var p2 = getLocalPosition(sx + s.width, sy, s);
// bottom left
var p3 = getLocalPosition(sx, sy + s.height, s);
// bottom right
var p4 = getLocalPosition(sx + s.width, sy + s.height, s);
p1.add(s.x, s.y);
p2.add(s.x, s.y);
p3.add(s.x, s.y);
p4.add(s.x, s.y);
// game.debug.renderPoint(tl, 'rgb(255,0,0)');
// game.debug.renderPoint(tr, 'rgb(0,255,0)');
// game.debug.renderPoint(bl, 'rgb(0,0,255)');
// game.debug.renderPoint(br, 'rgb(255,0,255)');
game.debug.renderPoint(p1, 'rgb(255,0,0)');
game.debug.renderPoint(p2, 'rgb(0,255,0)');
game.debug.renderPoint(p3, 'rgb(0,0,255)');
game.debug.renderPoint(p4, 'rgb(255,0,255)');
game.debug.renderText('tx: ' + tr.x, 32, 250);
game.debug.renderText('ty: ' + tr.y, 32, 265);
game.debug.renderText('px: ' + p2.x, 32, 280);
game.debug.renderText('py: ' + p2.y, 32, 295);
game.debug.renderText('ox: ' + offsetX, 32, 350);
game.debug.renderText('oy: ' + offsetY, 32, 370);
}
function getLocalPosition (x, y, displayObject) {
var a00 = displayObject.worldTransform[0]; // scaleX
var a01 = displayObject.worldTransform[1]; // skewY
var a02 = displayObject.worldTransform[2]; // translateX
var a10 = displayObject.worldTransform[3]; // skewX
var a11 = displayObject.worldTransform[4]; // scaleY
var a12 = displayObject.worldTransform[5]; // translateY
a01 *= -1;
a10 *= -1;
var id = 1 / (a00 * a11 + a01 * -a10);
var dx = a11 * id * x + -a01 * id * y + (a12 * a01 - a02 * a11) * id;
var dy = a00 * id * y + -a10 * id * x + (-a12 * a00 + a02 * a10) * id;
return new Phaser.Point(dx * displayObject.scale.x, dy * displayObject.scale.y);
}
})();
</script>
</body>
</html>
-74
View File
@@ -1,74 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
var s;
var s2;
function preload() {
game.load.image('card', 'assets/sprites/mana_card.png');
game.load.image('mushroom', 'assets/sprites/mushroom2.png');
}
function create() {
s = game.add.sprite(game.world.centerX, game.world.centerY, 'card');
s2 = game.add.sprite(100, 100, 'mushroom');
s.addChild(s2);
s.scale.x = 2;
s.scale.y = 2;
s2.scale.x = 0.5;
s2.scale.y = 0.5;
s.anchor.setTo(0.5, 0.5);
s2.anchor.setTo(0, 0);
}
function update() {
s.angle += 0.5;
s2.angle += 1;
}
function render() {
game.debug.renderWorldTransformInfo(s, 32, 32);
game.debug.renderLocalTransformInfo(s, 300, 32);
game.debug.renderWorldTransformInfo(s2, 32, 450);
game.debug.renderLocalTransformInfo(s2, 300, 450);
game.debug.renderPoint(s.topLeft, 'rgb(255,0,0)');
game.debug.renderPoint(s.topRight, 'rgb(0,255,0)');
game.debug.renderPoint(s.bottomLeft, 'rgb(0,0,255)');
game.debug.renderPoint(s.bottomRight, 'rgb(255,0,255)');
game.debug.renderPoint(s2.topLeft, 'rgb(255,0,0)');
game.debug.renderPoint(s2.topRight, 'rgb(0,255,0)');
game.debug.renderPoint(s2.bottomLeft, 'rgb(0,0,255)');
game.debug.renderPoint(s2.bottomRight, 'rgb(255,0,255)');
}
})();
</script>
</body>
</html>
-56
View File
@@ -1,56 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
var mummy;
function preload() {
game.load.spritesheet('mummy', 'assets/sprites/metalslug_mummy37x45.png', 37, 45, 18);
}
function create() {
mummy = game.add.sprite(0, 300, 'mummy');
mummy.scale.setTo(2, 2);
mummy.animations.add('walk');
mummy.animations.play('walk', 50, true);
game.add.tween(mummy).to({ x: game.width - 100 }, 20000, Phaser.Easing.Linear.None, true);
}
function update() {
mummy.angle += 1;
}
function render() {
game.debug.renderRectangle(mummy.bounds, 'rgba(255,255,0,0.1)');
game.debug.renderPoint(mummy.topLeft, 'rgb(255,0,0)');
game.debug.renderPoint(mummy.topRight, 'rgb(0,255,0)');
game.debug.renderPoint(mummy.bottomLeft, 'rgb(0,0,255)');
game.debug.renderPoint(mummy.bottomRight, 'rgb(255,0,255)');
}
})();
</script>
</body>
</html>
-70
View File
@@ -1,70 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
var core;
var core2;
function preload() {
game.load.image('bling', 'assets/sprites/diamond.png');
}
function create() {
core = game.add.sprite(game.world.centerX, game.world.centerY, 'bling');
core.anchor.setTo(0.5, 0.5);
core2 = game.add.sprite(game.world.centerX, game.world.centerY, 'bling');
core2.anchor.setTo(0.5, 0.5);
for (var i = 1; i < 50; i++)
{
var d = game.add.sprite(Math.cos(i) * 300, Math.sin(i) * 100, 'bling')
d.anchor.setTo(0.5, 0.5);
d.angle = Math.random() * 300;
core.addChild(d);
var d = game.add.sprite(Math.cos(i) * 360, Math.sin(i) * 100, 'bling')
d.anchor.setTo(0.5, 0.5);
d.angle = Math.random() * 300;
core2.addChild(d);
}
}
function update() {
core.angle += 1;
core2.angle -= 1;
for (var d in core.children) {
core.children[d].angle += 4;
}
for (var d in core2.children) {
core2.children[d].angle -= 4;
}
}
function render() {
}
})();
</script>
</body>
</html>
-68
View File
@@ -1,68 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('disk', 'assets/sprites/ra_dont_crack_under_pressure.png');
}
var s;
function create() {
game.world._stage.backgroundColorString = '#182d3b';
s = game.add.sprite(game.world.centerX, game.world.centerY, 'disk');
s.anchor.setTo(0.5, 0.5);
}
function update() {
s.rotation += 0.01;
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT))
{
s.x -= 4;
}
else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT))
{
s.x += 4;
}
if (game.input.keyboard.isDown(Phaser.Keyboard.UP))
{
s.y -= 4;
}
else if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN))
{
s.y += 4;
}
}
function render() {
game.debug.renderSpriteCorners(s, true, true);
game.debug.renderSpriteInfo(s, 20, 32);
}
})();
</script>
</body>
</html>
-79
View File
@@ -1,79 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
// Lots of assets
game.load.image('stars', 'assets/misc/starfield.jpg');
game.load.image('atari1', 'assets/sprites/atari130xe.png');
game.load.image('mushroom', 'assets/sprites/mushroom2.png');
}
var s;
var p;
function create() {
// Make our world big ...
game.world.setSize(4000, 2000);
// Scrolling background
s = game.add.tileSprite(0, 0, 800, 600, 'stars');
s.scrollFactor.setTo(0, 0);
// Now let's create loads of stuff moving around it
for (var i = 0; i < 250; i++)
{
var temp = game.add.sprite(game.world.randomX, game.world.randomY, 'mushroom');
temp.autoCull = true;
}
p = game.add.sprite(200, 200, 'atari1');
p.body.velocity.setTo(200 + Math.random() * 100, 200 + Math.random() * 100);
p.body.bounce.setTo(1, 1);
p.body.collideWorldBounds = true;
game.camera.follow(p);
}
function update() {
if (!game.camera.atLimit.x)
{
s.tilePosition.x -= p.body.deltaX();
}
if (!game.camera.atLimit.y)
{
s.tilePosition.y -= p.body.deltaY();
}
}
function render() {
game.debug.renderCameraInfo(game.camera, 32, 32);
game.debug.renderText('Sprites rendered: ' + game.world.currentRenderOrderID, 32, 100);
}
})();
</script>
</body>
</html>
-45
View File
@@ -1,45 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/math/Math.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/time/Time.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
var game = new Phaser.Game(this, '', 800, 600);
var c = new Phaser.Circle(100, 100, 32);
console.log(c.toString());
var p = { x: 0, y: 0 };
Phaser.Circle.circumferencePoint(c, 45, true, p);
console.log('Circumference Point', p);
c.radius = 200;
console.log(c.toString());
</script>
</body>
</html>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Group vs. Group Collision";
require('../head.php');
?>
<script type="text/javascript">
@@ -111,7 +106,9 @@
}
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Group vs. Group Collision";
require('../head.php');
?>
<script type="text/javascript">
@@ -96,5 +91,6 @@
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Group vs. Group Collision";
require('../head.php');
?>
<script type="text/javascript">
@@ -92,5 +87,6 @@
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Group vs. Group Collision";
require('../head.php');
?>
<script type="text/javascript">
@@ -61,5 +56,6 @@
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
-84
View File
@@ -1,84 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<textarea id="output" style="width: 800px; height: 400px">xxx</textarea>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(50, 50, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('piccie', 'assets/sprites/phaser_tiny.png');
// game.load.image('piccie', 'assets/sprites/carrot.png');
// game.load.image('piccie', 'assets/sprites/phaser-dude.png');
// game.load.image('piccie', 'assets/pics/atari_fujilogo.png');
}
var canvas;
var context;
var logo;
function create() {
logo = game.add.sprite(0, 0, 'piccie');
logo.body.velocity = 10;
}
function colorToHex(color) {
return "0123456789ABCDEF".charAt((color - (color % 16)) / 16) + "0123456789ABCDEF".charAt(color % 16);
}
function canvasToConsole() {
console.clear();
for (var y = 0; y < game.height; y++)
{
// var line = '';
var c = [];
var previousColor = '';
for (var x = 0; x < game.width; x++)
{
var rgb = game.renderer.context.getImageData(x, y, 1, 1);
var s = "#" + colorToHex(rgb.data[0]) + colorToHex(rgb.data[1]) + colorToHex(rgb.data[2]);
c.push("'background: " + s + "'");
}
console.log('%c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c ',
c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8], c[9],
c[10], c[11], c[12], c[13], c[14], c[15], c[16], c[17], c[18], c[19],
c[20], c[21], c[22], c[23], c[24], c[25], c[26], c[27], c[28], c[29],
c[30], c[31], c[32], c[33], c[34], c[35], c[36], c[37], c[38], c[39],
c[40], c[41], c[42], c[43], c[44], c[45], c[46], c[47], c[48], c[49],
c[50]);
}
}
function update() {
canvasToConsole();
}
function render() {
}
})();
</script>
</body>
</html>
-86
View File
@@ -1,86 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(50, 30, Phaser.CANVAS, '', { preload: preload, create: create, update: update });
function preload() {
game.load.image('background', 'assets/bd/back2.png');
// game.load.image('piccie', 'assets/sprites/phaser_tiny.png');
game.load.image('scroller', 'assets/bd/scroller.png');
}
var back;
var logo;
var scroller;
var t = 0;
function create() {
back = game.add.sprite(0, 0, 'background');
scroller = game.add.sprite(50, 10, 'scroller');
// logo = game.add.sprite(0, 0, 'piccie');
back.body.moves = false;
// logo.body.velocity.setTo(1,1);
// logo.body.bounce.setTo(1, 1);
// logo.body.collideWorldBounds = true;
game.add.tween(back).to( { y: -60 }, 20000, Phaser.Easing.Linear.None, true, 0, 1000, true);
game.add.tween(scroller).to( { x: -700 }, 700*250, Phaser.Easing.Linear.None, true, 0, 1000);
}
function update() {
if (game.time.now > t)
{
canvasToConsole();
t = game.time.now + 1000;
}
back.y -= 1;
}
function canvasToConsole() {
console.clear();
for (var y = 0; y < game.height; y++)
{
var c = [];
for (var x = 0; x < game.width; x++)
{
var rgb = game.renderer.context.getImageData(x, y, 1, 1);
var s = "#" + colorToHex(rgb.data[0]) + colorToHex(rgb.data[1]) + colorToHex(rgb.data[2]);
c.push("background: " + s + "");
}
console.log('%c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c %c ', c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], c[8], c[9], c[10], c[11], c[12], c[13], c[14], c[15], c[16], c[17], c[18], c[19], c[20], c[21], c[22], c[23], c[24], c[25], c[26], c[27], c[28], c[29], c[30], c[31], c[32], c[33], c[34], c[35], c[36], c[37], c[38], c[39], c[40], c[41], c[42], c[43], c[44], c[45], c[46], c[47], c[48], c[49]);
}
}
function colorToHex(color) {
return "0123456789ABCDEF".charAt((color - (color % 16)) / 16) + "0123456789ABCDEF".charAt(color % 16);
}
})();
</script>
</body>
</html>
-81
View File
@@ -1,81 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<textarea id="output" style="width: 1400px; height: 600px"></textarea>
<br />
<input type="button" id="grab" value="Grab" />
<input type="button" id="refresh" value="Refresh" />
<script type="text/javascript">
var game = new Phaser.Game(50, 31, Phaser.CANVAS, '', { preload: preload, create: create });
function preload() {
game.load.image('piccie', 'assets/bd/burd.png');
}
var logo;
var args;
function create() {
logo = game.add.sprite(0, 0, 'piccie');
document.getElementById('grab').onclick = canvasToConsole;
document.getElementById('refresh').onclick = refreshConsole;
}
function refreshConsole () {
args[0] = document.getElementById('output').value;
console.clear();
console.log.apply(console, args);
console.log(args.toString());
}
function canvasToConsole () {
var txt = "";
var prev;
args = [""];
var lfb = game.renderer.context.getImageData(0, 0, game.width, game.height).data;
for (var i = 0, j = 0; i < 1500; i++, j++)
{
if (!(i % 50)) // if(i && !(i % 50)) if don't like to start with a "\n"
txt += prev = "\n";
var col = "background: rgb(" + [lfb[j++], lfb[j++], lfb[j++]] + ")";
if (col == prev)
{
txt += " ";
}
else
{
txt += "%c ";
args.push(col);
prev = col;
}
}
args[0] = txt;
document.getElementById('output').innerText = args[0];
console.clear();
console.log.apply(console, args);
// console.log(args[0]);
}
</script>
</body>
</html>
-50
View File
@@ -1,50 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
// Your game will work either from within a closure or not, it doesn't matter
(function () {
// In this approach we're simply using functions in the current scope to do what we need
var game = new Phaser.Game(800, 600, Phaser.RENDERER_AUTO, '', { preload: preload, create: create });
function preload() {
console.log('*** preload called');
game.load.image('cockpit', 'assets/pics/cockpit.png');
game.load.image('rememberMe', 'assets/pics/remember-me.jpg');
game.load.image('overdose', 'assets/pics/lance-overdose-loader_eye.png');
game.load.text('copyright', 'assets/warning - copyright.txt');
}
function create() {
console.log('*** create called');
// Let's try adding an image to the DOM
document.body.appendChild(game.cache.getImage('cockpit'));
document.body.appendChild(game.cache.getImage('overdose'));
// And some text
var para = document.createElement('pre');
para.innerHTML = game.cache.getText('copyright');
document.body.appendChild(para);
}
})();
</script>
</body>
</html>
-53
View File
@@ -1,53 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var state = new Phaser.State();
state.preload = function() {
console.log('state preload called', this);
// When an instance of Phaser.State is added to Phaser.Game it becomes bound to that game
// which opens up lots of handy short-cuts to helpers and libs, such as this.math, this.load, this.cache, etc
this.load.image('cockpit', 'assets/pics/cockpit.png');
this.load.image('rememberMe', 'assets/pics/remember-me.jpg');
this.load.image('overdose', 'assets/pics/lance-overdose-loader_eye.png');
this.load.text('copyright', 'assets/warning - copyright.txt');
}
state.create = function() {
console.log('state create called');
// Let's try adding an image to the DOM
document.body.appendChild(this.cache.getImage('overdose'));
// And some text
var para = document.createElement('pre');
para.innerHTML = this.cache.getText('copyright');
document.body.appendChild(para);
}
// In this approach we're using a Phaser.State object and switching to it
// This gives us the advantage that from within state functions you can access 'this' and most the properties of Phaser.Game
var game = new Phaser.Game(800, 600, Phaser.RENDERER_AUTO, '', state);
})();
</script>
</body>
</html>
-48
View File
@@ -1,48 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var state = {
preload: function() {
console.log('state preload called');
game.load.image('rememberMe', 'assets/pics/remember-me.jpg');
game.load.text('copyright', 'assets/warning - copyright.txt');
},
create: function() {
console.log('state create called');
// Let's try adding an image to the DOM
document.body.appendChild(game.cache.getImage('rememberMe'));
// And some text
var para = document.createElement('pre');
para.innerHTML = game.cache.getText('copyright');
document.body.appendChild(para);
}
}
// In this example we're passing in a custom state object, not an instance of Phaser.State
var game = new Phaser.Game(800, 600, Phaser.RENDERER_AUTO, '', state);
})();
</script>
</body>
</html>
-49
View File
@@ -1,49 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
var MegaGame = {};
MegaGame.MainMenu = function (game) {
// A reference to the local game will always be passed to your state when created
// You should store it somewhere handy for use in your functions, like this ...
this.game = game;
};
MegaGame.MainMenu.prototype = {
preload: function () {
console.log('MainMenu.preload');
this.game.load.image('bladerunner', 'assets/pics/acryl_bladerunner.png');
},
create: function () {
console.log('MainMenu.create');
document.body.appendChild(this.game.cache.getImage('bladerunner'));
}
};
(function () {
// Finally in this example we pass in a custom State object which will be created upon boot
var game = new Phaser.Game(800, 600, Phaser.RENDERER_AUTO, '', MegaGame.MainMenu);
})();
</script>
</body>
</html>
-57
View File
@@ -1,57 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var mainMenu = {
preload: function() {
console.log('mainMenu preload');
game.load.image('nocooper', 'assets/pics/1984-nocooper-space.png');
},
create: function() {
console.log('mainMenu create');
document.body.appendChild(game.cache.getImage('nocooper'));
}
}
var levelSelect = {
preload: function() {
console.log('levelSelect preload');
game.load.image('touhou', 'assets/pics/aya_touhou_teng_soldier.png');
},
create: function() {
console.log('levelSelect create');
document.body.appendChild(game.cache.getImage('touhou'));
}
}
// No parameters given, which means no default state is created or started
var game = new Phaser.Game();
// In this example we've created 2 states above (mainMenu and levelSelect)
// We'll add them both to the game
game.state.add('menu', mainMenu);
game.state.add('select', levelSelect);
// Now we can either start the state we want directly, or we could have passed 'true' as the 3rd parameter in state.add
game.state.start('select');
})();
</script>
</body>
</html>
-59
View File
@@ -1,59 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<input type="button" id="menu" value="Main Menu" />
<input type="button" id="select" value="Level Select" />
<script type="text/javascript">
(function () {
var preloader = {
preload: function() {
console.log('preloader.preload');
game.load.image('nocooper', 'assets/pics/1984-nocooper-space.png');
game.load.image('touhou', 'assets/pics/aya_touhou_teng_soldier.png');
}
}
var mainMenu = {
create: function() {
console.log('mainMenu create');
document.body.appendChild(game.cache.getImage('nocooper'));
}
}
var levelSelect = {
create: function() {
console.log('levelSelect create');
document.body.appendChild(game.cache.getImage('touhou'));
}
}
// No parameters given, which means no default state is created or started
var game = new Phaser.Game();
game.state.add('preloader', preloader, true);
game.state.add('menu', mainMenu);
game.state.add('select', levelSelect);
var b1 = document.getElementById('menu').onclick = function() { game.state.start('menu') };
var b2 = document.getElementById('select').onclick = function() { game.state.start('select') };
})();
</script>
</body>
</html>
+14
View File
@@ -0,0 +1,14 @@
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-44006568-1', 'phaser.io');
ga('send', 'pageview');
</script>
</body>
</html>
-63
View File
@@ -1,63 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
<style type="text/css">
body {
margin: 0;
}
</style>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('atari1', 'assets/sprites/atari130xe.png');
}
function create() {
var tempSprite = game.add.sprite(0, 0, 'atari1');
game.stage.backgroundColor = '#e3ed49';
// Testing iOS7 lack of fullscreen. Damnit.
document.documentElement['style'].minHeight = '2000px';
window.scrollTo(0, document.body.scrollHeight);
game.input.onDown.add(gofull, this);
}
function gofull() {
game.stage.scale.startFullScreen();
}
function update() {
if (document.getElementsByTagName('body')[0].scrollTop > 1000)
{
game.stage.backgroundColor = '#87ff55';
window.scrollTo(0, 0);
}
}
function render() {
}
})();
</script>
</body>
</html>
-47
View File
@@ -1,47 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
var s;
function preload() {
game.load.image('test', 'assets/sprites/mana_card.png');
}
function create() {
s = game.add.sprite(game.world.centerX, game.world.centerY, 'test');
s.anchor.setTo(0.5, 0.5);
}
function update() {
s.angle += 1;
}
function render() {
game.debug.renderRectangle(s.bounds);
}
})();
</script>
</body>
</html>
-80
View File
@@ -1,80 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, render: render });
function preload() {
game.load.image('atari1', 'assets/sprites/atari130xe.png');
}
var graphics;
function create() {
graphics = game.add.graphics(0, 0);
// set a fill and line style
graphics.beginFill(0xFF3300);
graphics.lineStyle(10, 0xffd900, 1);
// draw a shape
graphics.moveTo(50,50);
graphics.lineTo(250, 50);
graphics.lineTo(100, 100);
graphics.lineTo(250, 220);
graphics.lineTo(50, 220);
graphics.lineTo(50, 50);
graphics.endFill();
// set a fill and line style again
graphics.lineStyle(10, 0xFF0000, 0.8);
graphics.beginFill(0xFF700B, 1);
// draw a second shape
graphics.moveTo(210,300);
graphics.lineTo(450,320);
graphics.lineTo(570,350);
graphics.lineTo(580,20);
graphics.lineTo(330,120);
graphics.lineTo(410,200);
graphics.lineTo(210,300);
graphics.endFill();
// draw a rectangel
graphics.lineStyle(2, 0x0000FF, 1);
graphics.drawRect(50, 250, 100, 100);
// draw a circle
graphics.lineStyle(0);
graphics.beginFill(0xFFFF0B, 0.5);
graphics.drawCircle(470, 200,100);
graphics.lineStyle(20, 0x33FF00);
graphics.moveTo(30,30);
graphics.lineTo(600, 300);
game.add.tween(graphics).to({ x: 200 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true);
}
function render() {
}
})();
</script>
</body>
</html>
-84
View File
@@ -1,84 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('diamond', 'assets/sprites/diamond.png');
game.load.image('carrot', 'assets/sprites/carrot.png');
}
var g;
var t;
var s;
function create() {
t = game.add.sprite(100, 100, 'carrot');
t.name = 'c0';
t.body.bounce.y = Math.random();
t.body.collideWorldBounds = true;
g = game.add.group();
// g.x = 400;
// g.y = 300;
// g._container.anchor.x = 0.5;
// g._container.anchor.y = 0.5;
for (var i = 0; i < 10; i++)
{
var x = 50 + (i * 64);
s = g.create(x, 100, 'diamond');
s.name = 'd' + i;
s.anchor.setTo(0.5, 0.5);
}
// g.forEach(setAlpha, this);
// g.dump();
// g.replace(s, t);
// g.dump();
// g.callAll('dump', game, 123, 456, 789);
// g.getRandom().y += 200;
// g.setAll('body.velocity.y', 250);
// g.divideAll('y', 2);
// g.multiplyAll('y', 3);
}
function setAlpha (sprite) {
sprite.alpha = 0.4;
}
function update() {
g.addAll('angle', 10);
// g.angle++;
}
function render() {
}
})();
</script>
</body>
</html>
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>phaser - <?php echo $title?></title>
<base href="../">
<?php
require('js.php');
if (isset($mobile))
{
?>
<meta name="viewport" content="initial-scale=1 maximum-scale=1 user-scalable=0" />
<?php
}
?>
</head>
<body>
+79
View File
@@ -0,0 +1,79 @@
<?php
function dirToArray($dir) {
$ignore = array('.', '..', 'Tests.csproj', 'Tests.csproj.user', 'bin', 'index.php', 'phaser.css', 'obj', 'assets', 'states', 'Phaser Tests.sublime-project');
$result = array();
$root = scandir($dir);
$dirs = array_diff($root, $ignore);
foreach ($dirs as $key => $value)
{
if (is_dir($dir . DIRECTORY_SEPARATOR . $value))
{
$result[$value] = dirToArray($dir . DIRECTORY_SEPARATOR . $value);
}
else
{
if (substr($value, -4) == '.php')
{
$result[] = $value;
}
}
}
return $result;
}
function printJSLinks($dir, $files) {
foreach ($files as $key => $value)
{
$value2 = substr($value, 0, -4);
echo "<a href=\"$dir/$value\" class=\"button\">$value2</a>";
}
}
$files = dirToArray(dirname(__FILE__));
$total = 0;
foreach ($files as $key => $value)
{
if (is_array($value) && count($value) > 0)
{
$total += count($value);
}
}
?>
<!DOCTYPE HTML>
<head>
<meta charset="utf-8" />
<title>Phaser Examples</title>
<link rel="stylesheet" href="phaser.css" type="text/css" />
</head>
<body>
<div id="header">
<h1 id="title">Phaser Test Suite</h1>
</div>
<div id="links">
<?php
echo "<h2>Total Tests: $total </h2>";
foreach ($files as $key => $value)
{
// If $key is an array, output it as an h2 or something
if (is_array($value) && count($value) > 0)
{
echo "<h2>$key (" . count($value) . " examples)</h2>";
printJSLinks($key, $value);
}
}
?>
</div>
</body>
</html>
-167
View File
@@ -1,167 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
//require('js.php');
?>
</head>
<body>
<script type="text/javascript">
function isPlainObject ( obj ) {
// Not plain objects:
// - Any object or value whose internal [[Class]] property is not "[object Object]"
// - DOM nodes
// - window
if (typeof(obj) !== "object" || obj.nodeType || obj === obj.window) {
return false;
}
// Support: Firefox <20
// The try/catch suppresses exceptions thrown when attempting to access
// the "constructor" property of certain host objects, ie. |window.location|
// https://bugzilla.mozilla.org/show_bug.cgi?id=814622
try {
if ( obj.constructor &&
!hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
return false;
}
} catch ( e ) {
return false;
}
// If the function hasn't returned already, we're confident that
// |obj| is a plain object, created by {} or constructed with new Object
return true;
}
function extend () {
var options, name, src, copy, copyIsArray, clone,
target = arguments[0] || {},
i = 1,
length = arguments.length,
deep = false;
// Handle a deep copy situation
if ( typeof target === "boolean" ) {
deep = target;
target = arguments[1] || {};
// skip the boolean and the target
i = 2;
}
// extend jQuery itself if only one argument is passed
if ( length === i ) {
target = this;
--i;
}
console.log('extending',length,options,deep);
for ( ; i < length; i++ ) {
// Only deal with non-null/undefined values
if ( (options = arguments[ i ]) != null ) {
// Extend the base object
for ( name in options ) {
src = target[ name ];
copy = options[ name ];
console.log('extending',src,copy);
// Prevent never-ending loop
if ( target === copy ) {
continue;
}
// Recurse if we're merging plain objects or arrays
if ( deep && copy && ( isPlainObject(copy) || (copyIsArray = Array.isArray(copy)) ) ) {
if ( copyIsArray ) {
copyIsArray = false;
clone = src && Array.isArray(src) ? src : [];
} else {
clone = src && isPlainObject(src) ? src : {};
}
// Never move original objects, clone them
target[ name ] = extend( deep, clone, copy );
// Don't bring in undefined values
} else if ( copy !== undefined ) {
target[ name ] = copy;
}
}
}
}
// Return the modified object
return target;
};
Bob = {};
Bob.Coke = function (x, y) {
this.x = x;
this.y = y;
}
Bob.Coke.prototype = {
fizz: function () {
console.log('fizz', this.x, this.y);
}
}
Bob.Sprite = function (x, y) {
this.x = x;
this.y = y;
}
Bob.Sprite.prototype = {
test: function () {
console.log('bob', this.x, this.y);
},
nipples: function () {
console.log('bob nipples');
}
}
Bob.Extra = function (x, y) {
Bob.Sprite.call(this, x, y);
// Bob.Coke.call(this, x, y);
}
// Bob.Extra.prototype = Object.create(Bob.Sprite.prototype);
Bob.Extra.prototype.solid = function () {
console.log('extra solids');
}
Bob.Extra.prototype = extend(true, Bob.Extra.prototype, Bob.Sprite.prototype, Bob.Coke.prototype);
var rich = new Bob.Extra(99,100);
console.log(rich);
var sus = new Bob.Extra(500,123);
console.log(sus);
rich.test();
rich.solid();
rich.fizz();
console.log('ssssss');
sus.test();
sus.solid();
sus.fizz();
</script>
</body>
</html>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Test Title";
require('../head.php');
?>
<script type="text/javascript">
@@ -50,5 +45,6 @@
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Test Title";
require('../head.php');
?>
<script type="text/javascript">
@@ -51,5 +46,6 @@
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
+7 -11
View File
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Test Title";
require('../head.php');
?>
<script type="text/javascript">
@@ -39,5 +34,6 @@
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Test Title";
require('../head.php');
?>
<script type="text/javascript">
@@ -62,5 +57,6 @@
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Test Title";
require('../head.php');
?>
<script type="text/javascript">
@@ -65,5 +60,6 @@
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Test Title";
require('../head.php');
?>
<script type="text/javascript">
@@ -114,5 +109,6 @@
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
+7 -11
View File
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Test Title";
require('../head.php');
?>
<script type="text/javascript">
@@ -50,5 +45,6 @@
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
-48
View File
@@ -1,48 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<input type="text" id="mx" value="0" />
<input type="text" id="my" value="0" />
<br />
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });
function preload() {
game.load.image('mushroom', 'assets/sprites/mushroom2.png');
}
function create() {
game.add.sprite(0, 0, 'mushroom');
game.input.onDown.add(newMushroom, this);
}
function newMushroom(pointer) {
game.add.sprite(pointer.x, pointer.y, 'mushroom');
}
function update() {
document.getElementById('mx').value = game.input.x;
document.getElementById('my').value = game.input.y;
}
})();
</script>
</body>
</html>
-60
View File
@@ -1,60 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
<style type="text/css">
body {
margin: 0;
}
</style>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(400, 300, Phaser.AUTO, '', { preload: preload, create: create, update: update });
function preload() {
game.load.image('mushroom', 'assets/sprites/mushroom2.png');
}
var m;
function create() {
// game.stage.canvas.style['-webkit-transform-origin'] = 'top left';
// game.stage.canvas.style['-webkit-transform'] = 'scale(3,3)';
// game.stage.scaleMode = Phaser.StageScaleMode.EXACT_FIT;
// game.stage.scale.
// game.stage.scale.setScreenSize();
m = game.add.sprite(0, 0, 'mushroom');
m.anchor.setTo(0.5, 0.5);
// game.input.onDown.add(newMushroom, this);
}
function newMushroom(pointer) {
// game.add.sprite(pointer.x, pointer.y, 'mushroom');
}
function update() {
m.x = game.input.x;
m.y = game.input.y;
}
})();
</script>
</body>
</html>
-63
View File
@@ -1,63 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('alien', 'assets/sprites/space-baddie.png');
game.load.image('ship', 'assets/sprites/shmup-ship.png');
}
var player;
var aliens;
function create() {
player = game.add.sprite(400, 500, 'ship');
player.anchor.setTo(0.5, 0.5);
aliens = game.add.group();
for (var y = 0; y < 4; y++)
{
for (var x = 0; x < 10; x++)
{
aliens.create(x * 48, y * 50, 'alien');
}
}
aliens.x = 100;
aliens.y = 50;
var tween = game.add.tween(aliens).to({x: 200}, 3000, Phaser.Easing.Linear.None, true, 0, 1000, true);
tween.onComplete.add(descend, this);
}
function descend() {
aliens.y += 10;
}
function update() {
}
function render() {
}
})();
</script>
</body>
</html>
-90
View File
@@ -2,95 +2,6 @@
// All JS files in build order.
// Much easier for debugging
?>
<script src="../src/pixi/Pixi.js"></script>
<script src="../src/Phaser.js"></script>
<script src="../src/utils/Utils.js"></script>
<script src="../src/pixi/core/Matrix.js"></script>
<script src="../src/pixi/core/Point.js"></script>
<script src="../src/pixi/core/Rectangle.js"></script>
<script src="../src/pixi/display/DisplayObject.js"></script>
<script src="../src/pixi/display/DisplayObjectContainer.js"></script>
<script src="../src/pixi/display/Sprite.js"></script>
<script src="../src/pixi/display/MovieClip.js"></script>
<script src="../src/pixi/display/Stage.js"></script>
<script src="../src/pixi/extras/CustomRenderable.js"></script>
<script src="../src/pixi/extras/Strip.js"></script>
<script src="../src/pixi/extras/Rope.js"></script>
<script src="../src/pixi/extras/Spine.js"></script>
<script src="../src/pixi/extras/TilingSprite.js"></script>
<script src="../src/pixi/filters/FilterBlock.js"></script>
<script src="../src/pixi/filters/MaskFilter.js"></script>
<script src="../src/pixi/primitives/Graphics.js"></script>
<script src="../src/pixi/renderers/canvas/CanvasGraphics.js"></script>
<script src="../src/pixi/renderers/canvas/CanvasRenderer.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLBatch.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLGraphics.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLRenderer.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLRenderGroup.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLShaders.js"></script>
<script src="../src/pixi/text/BitmapText.js"></script>
<script src="../src/pixi/text/Text.js"></script>
<script src="../src/pixi/textures/BaseTexture.js"></script>
<script src="../src/pixi/textures/Texture.js"></script>
<script src="../src/pixi/textures/RenderTexture.js"></script>
<script src="../src/pixi/utils/EventTarget.js"></script>
<script src="../src/pixi/utils/Polyk.js"></script>
<script src="../src/core/Camera.js"></script>
<script src="../src/core/State.js"></script>
<script src="../src/core/StateManager.js"></script>
<script src="../src/core/LinkedList.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Plugin.js"></script>
<script src="../src/core/PluginManager.js"></script>
<script src="../src/core/Stage.js"></script>
<script src="../src/core/Group.js"></script>
<script src="../src/core/World.js"></script>
<script src="../src/core/Game.js"></script>
<script src="../src/input/Input.js"></script>
<script src="../src/input/Keyboard.js"></script>
<script src="../src/input/Mouse.js"></script>
<script src="../src/input/MSPointer.js"></script>
<script src="../src/input/Pointer.js"></script>
<script src="../src/input/Touch.js"></script>
<script src="../src/input/InputHandler.js"></script>
<script src="../src/system/Canvas.js"></script>
<script src="../src/gameobjects/Events.js"></script>
<script src="../src/gameobjects/GameObjectFactory.js"></script>
<script src="../src/gameobjects/Sprite.js"></script>
<script src="../src/gameobjects/TileSprite.js"></script>
<script src="../src/gameobjects/Text.js"></script>
<script src="../src/system/Canvas.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/system/RequestAnimationFrame.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/math/Math.js"></script>
<script src="../src/math/QuadTree.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Rectangle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/tween/TweenManager.js"></script>
<script src="../src/tween/Tween.js"></script>
<script src="../src/tween/Easing.js"></script>
<script src="../src/time/Time.js"></script>
<script src="../src/animation/AnimationManager.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/sound/Sound.js"></script>
<script src="../src/sound/SoundManager.js"></script>
<script src="../src/utils/Debug.js"></script>
<script src="../src/physics/arcade/ArcadePhysics.js"></script>
<script src="../src/physics/arcade/Body.js"></script>
<script src="../src/physics/advanced/Math.js"></script>
<script src="../src/physics/advanced/Util.js"></script>
<script src="../src/physics/advanced/Collision.js"></script>
@@ -113,4 +24,3 @@
<script src="../src/physics/advanced/shapes/Poly.js"></script>
<script src="../src/physics/advanced/shapes/Triangle.js"></script>
<script src="../src/physics/advanced/shapes/Box.js"></script>
+2 -2
View File
@@ -1,6 +1,6 @@
<?php
// All JS files in build order. Much easier for debugging
// <xscript src="../src/pixi/extras/Spine.js"></script> <xscript src="../src/pixi/display/MovieClip.js"></script>
// All JS files in build order.
// Much easier for debugging re: line numbers
?>
<script src="../src/Intro.js"></script>
<script src="../src/pixi/Pixi.js"></script>
-120
View File
@@ -1,120 +0,0 @@
<?php
// All JS files in build order.
// Much easier for debugging
?>
<script src="../src/Phaser.js"></script>
<script src="../src/utils/Utils.js"></script>
<script src="../src/pixi/Pixi.js"></script>
<script src="../src/pixi/InteractionManager.js"></script>
<script src="../src/pixi/core/Circle.js"></script>
<script src="../src/pixi/core/Ellipse.js"></script>
<script src="../src/pixi/core/Matrix.js"></script>
<script src="../src/pixi/core/Point.js"></script>
<script src="../src/pixi/core/Polygon.js"></script>
<script src="../src/pixi/core/Rectangle.js"></script>
<script src="../src/pixi/display/DisplayObject.js"></script>
<script src="../src/pixi/display/DisplayObjectContainer.js"></script>
<script src="../src/pixi/display/Sprite.js"></script>
<script src="../src/pixi/display/MovieClip.js"></script>
<script src="../src/pixi/display/Stage.js"></script>
<script src="../src/pixi/extras/CustomRenderable.js"></script>
<script src="../src/pixi/extras/Strip.js"></script>
<script src="../src/pixi/extras/Rope.js"></script>
<script src="../src/pixi/extras/Spine.js"></script>
<script src="../src/pixi/extras/TilingSprite.js"></script>
<script src="../src/pixi/filters/FilterBlock.js"></script>
<script src="../src/pixi/filters/MaskFilter.js"></script>
<script src="../src/pixi/primitives/Graphics.js"></script>
<script src="../src/pixi/renderers/canvas/CanvasGraphics.js"></script>
<script src="../src/pixi/renderers/canvas/CanvasRenderer.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLBatch.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLGraphics.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLRenderer.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLRenderGroup.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLShaders.js"></script>
<script src="../src/pixi/text/BitmapText.js"></script>
<script src="../src/pixi/text/Text.js"></script>
<script src="../src/pixi/textures/BaseTexture.js"></script>
<script src="../src/pixi/textures/Texture.js"></script>
<script src="../src/pixi/textures/RenderTexture.js"></script>
<script src="../src/pixi/utils/EventTarget.js"></script>
<script src="../src/pixi/utils/Polyk.js"></script>
<script src="../src/pixi/utils/Utils.js"></script>
<script src="../src/core/Camera.js"></script>
<script src="../src/core/State.js"></script>
<script src="../src/core/StateManager.js"></script>
<script src="../src/core/LinkedList.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Plugin.js"></script>
<script src="../src/core/PluginManager.js"></script>
<script src="../src/core/Stage.js"></script>
<script src="../src/core/Group.js"></script>
<script src="../src/core/World.js"></script>
<script src="../src/core/Game.js"></script>
<script src="../src/input/Input.js"></script>
<script src="../src/input/Keyboard.js"></script>
<script src="../src/input/Mouse.js"></script>
<script src="../src/input/MSPointer.js"></script>
<script src="../src/input/Pointer.js"></script>
<script src="../src/input/Touch.js"></script>
<script src="../src/input/InputHandler.js"></script>
<script src="../src/system/Canvas.js"></script>
<script src="../src/gameobjects/Events.js"></script>
<script src="../src/gameobjects/GameObjectFactory.js"></script>
<script src="../src/gameobjects/Sprite.js"></script>
<script src="../src/gameobjects/TileSprite.js"></script>
<script src="../src/gameobjects/Text.js"></script>
<script src="../src/system/Canvas.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/system/RequestAnimationFrame.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/math/Math.js"></script>
<script src="../src/math/QuadTree.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Rectangle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/tween/TweenManager.js"></script>
<script src="../src/tween/Tween.js"></script>
<script src="../src/tween/Easing.js"></script>
<script src="../src/time/Time.js"></script>
<script src="../src/animation/AnimationManager.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/sound/Sound.js"></script>
<script src="../src/sound/SoundManager.js"></script>
<script src="../src/utils/Debug.js"></script>
<script src="../src/physics/arcade/ArcadePhysics.js"></script>
<script src="../src/physics/arcade/Body.js"></script>
<script src="../src/physics/advanced/Math.js"></script>
<script src="../src/physics/advanced/Util.js"></script>
<script src="../src/physics/advanced/Collision.js"></script>
<script src="../src/physics/advanced/Body.js"></script>
<script src="../src/physics/advanced/Joint.js"></script>
<script src="../src/physics/advanced/Shape.js"></script>
<script src="../src/physics/advanced/Contact.js"></script>
<script src="../src/physics/advanced/ContactSolver.js"></script>
<script src="../src/physics/advanced/Space.js"></script>
<script src="../src/physics/advanced/joints/Angle.js"></script>
<script src="../src/physics/advanced/joints/Revolute.js"></script>
<script src="../src/physics/advanced/joints/Weld.js"></script>
<script src="../src/physics/advanced/joints/Wheel.js"></script>
<script src="../src/physics/advanced/joints/Prismatic.js"></script>
<script src="../src/physics/advanced/joints/Distance.js"></script>
<script src="../src/physics/advanced/joints/Rope.js"></script>
<script src="../src/physics/advanced/joints/Mouse.js"></script>
<script src="../src/physics/advanced/shapes/Circle.js"></script>
<script src="../src/physics/advanced/shapes/Segment.js"></script>
<script src="../src/physics/advanced/shapes/Poly.js"></script>
<script src="../src/physics/advanced/shapes/Triangle.js"></script>
<script src="../src/physics/advanced/shapes/Box.js"></script>
-74
View File
@@ -1,74 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('alien', 'assets/sprites/space-baddie.png');
game.load.image('ship', 'assets/sprites/shmup-ship.png');
}
var a;
var b;
var c;
var d;
var e;
var f;
var list;
function create() {
a = game.add.sprite(100, 100, 'ship');
a.name = 's1';
b = game.add.sprite(130, 100, 'ship');
b.name = 's2';
c = game.add.sprite(160, 100, 'ship');
c.name = 's3';
d = game.add.sprite(190, 100, 'alien');
d.name = 'a1';
e = game.add.sprite(220, 100, 'alien');
e.name = 'a2';
f = game.add.sprite(250, 100, 'alien');
f.name = 'a3';
list = new Phaser.LinkedList();
list.add(a.input);
list.add(b.input);
list.add(c.input);
list.add(d.input);
list.add(e.input);
list.add(f.input);
list.dump();
// list.remove(d.input);
// list.dump();
}
function update() {
}
function render() {
}
})();
</script>
</body>
</html>
-59
View File
@@ -1,59 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
function loadStarted(size) {
console.log('Loader started, queue size:', size);
}
// this.progress, previousKey, success, this.queueSize - this._keys.length, this.queueSize
function fileLoaded(progress, key, success, remaining, total) {
console.log('File Loaded:', key);
console.log('Progress: ' + progress + '%');
console.log('File: ' + remaining + ' out of ' + total);
}
function loadCompleted() {
console.log('Loader finished');
// Let's try adding an image to the DOM
document.body.appendChild(game.cache.getImage('cockpit'));
// And some text
var para = document.createElement('pre');
para.innerHTML = game.cache.getText('copyright');
document.body.appendChild(para);
}
var game = new Phaser.Game(this, '', 800, 600);
game.load.image('cockpit', 'assets/pics/cockpit.png');
game.load.image('rememberMe', 'assets/pics/remember-me.jpg');
game.load.image('overdose', 'assets/pics/lance-overdose-loader_eye.png');
game.load.text('copyright', 'assets/warning - copyright.txt');
game.load.onLoadStart.add(loadStarted, this);
game.load.onFileComplete.add(fileLoaded, this);
game.load.onLoadComplete.add(loadCompleted, this);
game.load.start();
</script>
</body>
</html>
-57
View File
@@ -1,57 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
function loadStarted(size) {
console.log('Loader started, queue size:', size);
}
// this.progress, previousKey, success, this.queueSize - this._keys.length, this.queueSize
function fileLoaded(progress, key, success, remaining, total) {
console.log('File Loaded:', key);
console.log('Progress: ' + progress + '%');
console.log('File: ' + remaining + ' out of ' + total);
}
function loadCompleted() {
console.log('Loader finished');
// Let's try adding an image to the DOM
document.body.appendChild(game.cache.getImage('bot'));
// Dump the animation data out
console.log(game.cache.getFrameData('bot'));
}
var game = new Phaser.Game(this, '', 800, 600);
game.load.atlasJSON('bot', 'assets/sprites/running_bot.png', 'assets/sprites/running_bot.json');
game.load.onLoadStart.add(loadStarted, this);
game.load.onFileComplete.add(fileLoaded, this);
game.load.onLoadComplete.add(loadCompleted, this);
game.load.start();
</script>
</body>
</html>
-57
View File
@@ -1,57 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
function loadStarted(size) {
console.log('Loader started, queue size:', size);
}
// this.progress, previousKey, success, this.queueSize - this._keys.length, this.queueSize
function fileLoaded(progress, key, success, remaining, total) {
console.log('File Loaded:', key);
console.log('Progress: ' + progress + '%');
console.log('File: ' + remaining + ' out of ' + total);
}
function loadCompleted() {
console.log('Loader finished');
// Let's try adding an image to the DOM
document.body.appendChild(game.cache.getImage('bot'));
// Dump the animation data out
console.log(game.cache.getFrameData('bot'));
}
var game = new Phaser.Game(this, '', 800, 600);
game.load.atlasXML('bot', 'assets/sprites/shoebot.png', 'assets/sprites/shoebot.xml');
game.load.onLoadStart.add(loadStarted, this);
game.load.onFileComplete.add(fileLoaded, this);
game.load.onLoadComplete.add(loadCompleted, this);
game.load.start();
</script>
</body>
</html>
-57
View File
@@ -1,57 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
function loadStarted(size) {
console.log('Loader started, queue size:', size);
}
// this.progress, previousKey, success, this.queueSize - this._keys.length, this.queueSize
function fileLoaded(progress, key, success, remaining, total) {
console.log('File Loaded:', key);
console.log('Progress: ' + progress + '%');
console.log('File: ' + remaining + ' out of ' + total);
}
function loadCompleted() {
console.log('Loader finished');
// Let's try adding an image to the DOM
//document.body.appendChild(game.cache.getImage('mummy'));
// Dump the animation data out
//console.log(game.cache.getFrameData('mummy'));
}
var game = new Phaser.Game(this, '', 800, 600);
game.load.audio('music', [ 'assets/audio/oedipus_wizball_highscore.mp3', 'assets/audio/oedipus_wizball_highscore.ogg' ], true);
game.load.onLoadStart.add(loadStarted, this);
game.load.onFileComplete.add(fileLoaded, this);
game.load.onLoadComplete.add(loadCompleted, this);
game.load.start();
</script>
</body>
</html>
-57
View File
@@ -1,57 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
function loadStarted(size) {
console.log('Loader started, queue size:', size);
}
// this.progress, previousKey, success, this.queueSize - this._keys.length, this.queueSize
function fileLoaded(progress, key, success, remaining, total) {
console.log('File Loaded:', key);
console.log('Progress: ' + progress + '%');
console.log('File: ' + remaining + ' out of ' + total);
}
function loadCompleted() {
console.log('Loader finished');
// Let's try adding an image to the DOM
document.body.appendChild(game.cache.getImage('mummy'));
// Dump the animation data out
console.log(game.cache.getFrameData('mummy'));
}
var game = new Phaser.Game(this, '', 800, 600);
game.load.spritesheet('mummy', 'assets/sprites/metalslug_mummy37x45.png', 37, 45);
game.load.onLoadStart.add(loadStarted, this);
game.load.onFileComplete.add(fileLoaded, this);
game.load.onLoadComplete.add(loadCompleted, this);
game.load.start();
</script>
</body>
</html>
-48
View File
@@ -1,48 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
function loadStarted(size) {
console.log('Loader started, queue size:', size);
}
// this.progress, previousKey, success, this.queueSize - this._keys.length, this.queueSize
function fileLoaded(progress, key, success, remaining, total) {
console.log('File Loaded:', key);
console.log('Progress: ' + progress + '%');
console.log('File: ' + remaining + ' out of ' + total);
}
function loadCompleted() {
console.log('Loader finished');
}
var game = new Phaser.Game(this, '', 800, 600);
game.load.image('cockpit', 'assets/pics/cockpit.png');
game.load.image('rememberMe', 'assets/pics/remember-me.jpg');
game.load.image('overdose', 'assets/pics/lance-overdose-loader_eye.png');
game.load.onLoadStart.add(loadStarted, this);
game.load.onFileComplete.add(fileLoaded, this);
game.load.onLoadComplete.add(loadCompleted, this);
game.load.start();
</script>
</body>
</html>
-48
View File
@@ -1,48 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - Super Mario Combo</title>
<script src="phaser-min.js"></script>
<style type="text/css">
body: {
margin: 0;
}
</style>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.tilemap('nes', 'gfx/mario1.png', 'gfx/mario1.json', null, Phaser.Tilemap.JSON);
game.load.tilemap('snes', 'gfx/smb_tiles.png', 'gfx/smb_level1.json', null, Phaser.Tilemap.JSON);
}
function create() {
game.stage.backgroundColor = '#5c94fc';
game.add.tilemap(0, 0, 'nes');
game.add.tilemap(0, 168, 'snes');
game.add.tween(game.camera).to( { x: 5120-800 }, 30000, Phaser.Easing.Linear.None, true, 0, 1000, true);
game.input.onDown.add(goFull, this);
}
function goFull() {
game.stage.scale.startFullScreen();
}
})();
</script>
</body>
</html>
File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 809 B

File diff suppressed because one or more lines are too long
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

-65
View File
@@ -1,65 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>phaser.js - Super Mario Combo</title>
<script src="phaser-min.js"></script>
<style type="text/css">
body {
margin: 0;
font-family: sans-serif;
}
p {
padding: 16px;
margin: 0px;
}
</style>
</head>
<body>
<div id="game"></div>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'game', { preload: preload, create: create });
function preload() {
game.load.image('phaser', 'assets/phaser.png');
game.load.tilemap('nes', 'assets/mario1.png', 'assets/mario1.json', null, Phaser.Tilemap.JSON);
game.load.tilemap('snes', 'assets/smb_tiles.png', 'assets/smb_level1.json', null, Phaser.Tilemap.JSON);
}
function create() {
game.stage.backgroundColor = '#5c94fc';
game.add.tilemap(0, 0, 'nes');
game.add.tilemap(0, 168, 'snes');
var logo = game.add.sprite(688, 8, 'phaser');
logo.scrollFactor.setTo(0, 0);
game.add.tween(game.camera).to( { x: 4320 }, 30000, Phaser.Easing.Linear.None, true, 0, 1000, true);
game.input.onDown.add(goFull, this);
}
function goFull() {
game.stage.scale.startFullScreen();
}
})();
</script>
<p>Potential game idea here? :)</p>
<p>Click game to full-screen (if supported)</p>
<p>Created with <a href="https://github.com/photonstorm/phaser">Phaser 1.0</a> by <a href="https://twitter.com/photonstorm">@photonstorm</a></p>
</body>
</html>
-69
View File
@@ -1,69 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - oh balls</title>
<script src="phaser-min.js"></script>
<style type="text/css">
body {
margin: 0;
font-family: sans-serif;
}
p {
padding: 16px;
margin: 0px;
}
</style>
</head>
<body>
<div id="game"></div>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'game', { preload: preload, create: create, update: update });
var p;
function preload() {
game.load.spritesheet('balls', 'assets/balls.png', 17, 17);
}
function create() {
game.stage.backgroundColor = 0x337799;
p = game.add.emitter(100, 100, 250);
p.makeParticles('balls', [0,1,2,3,4,5]);
p.minParticleSpeed.setTo(-100, -100);
p.maxParticleSpeed.setTo(100, -200);
p.gravity = 10;
p.start(false, 3000, 10);
game.add.tween(p).to({ x: 700 }, 1000, Phaser.Easing.Quadratic.InOut, true, 0, 1000, true);
}
function update() {
p.y = game.input.y;
if (p.y < 100)
{
p.y = 100;
}
}
})();
</script>
<p>Mouse to move</p>
<p>Created with <a href="https://github.com/photonstorm/phaser">Phaser 1.0</a> by <a href="https://twitter.com/photonstorm">@photonstorm</a></p>
</body>
</html>
-103
View File
@@ -1,103 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - mario party(cles)</title>
<script src="phaser-min.js"></script>
<style type="text/css">
body {
margin: 0;
font-family: sans-serif;
}
p {
padding: 16px;
margin: 0px;
}
</style>
</head>
<body>
<div id="game"></div>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'game', { preload: preload, create: create, update: update });
function preload() {
game.load.tilemap('background', 'assets/smb_bg.png', 'assets/smb_bg.json', null, Phaser.Tilemap.JSON);
game.load.tilemap('level1', 'assets/smb_tiles.png', 'assets/smb_level1.json', null, Phaser.Tilemap.JSON);
game.load.spritesheet('balls', 'assets/balls.png', 17, 17);
game.load.image('phaser', 'assets/phaser.png');
}
var p;
var map;
function create() {
game.stage.backgroundColor = '#787878';
game.add.tilemap(0, 0, 'background');
map = game.add.tilemap(0, 0, 'level1');
map.setCollisionByIndex([9,10,11,14,15,16,18,19,22,23,24,32,37,38], true, true, true, true);
p = game.add.emitter(300, 50, 500);
p.bounce = 0.5;
p.makeParticles('balls', [0,1,2,3,4,5], 500, 1);
p.minParticleSpeed.setTo(-150, 150);
p.maxParticleSpeed.setTo(100, 100);
p.gravity = 8;
p.start(false, 5000, 50);
var logo = game.add.sprite(688, 8, 'phaser');
logo.scrollFactor.setTo(0, 0);
game.add.tween(p).to({ x: 4000 }, 7500, Phaser.Easing.Quadratic.InOut, true, 0, 1000, true);
game.input.onDown.add(goFull, this);
}
function goFull() {
game.stage.scale.startFullScreen();
}
function update() {
map.collide(p);
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT))
{
game.camera.x -= 8;
}
else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT))
{
game.camera.x += 8;
}
if (game.input.keyboard.isDown(Phaser.Keyboard.UP))
{
game.camera.y -= 8;
}
else if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN))
{
game.camera.y += 8;
}
}
})();
</script>
<p>Left / Right arrows to scroll the map</p>
<p>Click game to full-screen (if supported)</p>
<p>Highlights a few visual glitches I need to work on :)</p>
<p>Created with <a href="https://github.com/photonstorm/phaser">Phaser 1.0</a> by <a href="https://twitter.com/photonstorm">@photonstorm</a></p>
</body>
</html>
-48
View File
@@ -1,48 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/RequestAnimationFrame.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/math/Math.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/tween/TweenManager.js"></script>
<script src="../src/tween/Tween.js"></script>
<script src="../src/tween/Easing.js"></script>
<script src="../src/time/Time.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
var game = new Phaser.Game(this, '', 800, 600);
var data = game.math.sinCosGenerator(10);
console.log('Sin', data.sin);
console.log('Cos', data.cos);
console.log('Shift value 1', game.math.shift(data.sin));
console.log('Shift value 2', game.math.shift(data.sin));
console.log('Shift value 3', game.math.shift(data.sin));
console.log('Shift value 4', game.math.shift(data.sin));
console.log('Sin', data.sin);
</script>
</body>
</html>
-98
View File
@@ -1,98 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('car', 'assets/sprites/car90.png');
game.load.image('ship', 'assets/sprites/xenon2_ship.png');
game.load.image('baddie', 'assets/sprites/space-baddie.png');
}
var car;
var ship;
var total;
var aliens;
function create() {
aliens = [];
for (var i = 0; i < 50; i++)
{
var s = game.add.sprite(game.world.randomX, game.world.randomY, 'baddie');
s.name = 'alien' + s;
s.body.collideWorldBounds = true;
s.body.bounce.setTo(1, 1);
s.body.velocity.setTo(10 + Math.random() * 40, 10 + Math.random() * 40);
aliens.push(s);
}
car = game.add.sprite(400, 300, 'car');
car.anchor.setTo(0.5, 0.5);
car.body.collideWorldBounds = true;
car.body.bounce.setTo(0.5, 0.5);
car.body.allowRotation = true;
ship = game.add.sprite(400, 400, 'ship');
ship.body.collideWorldBounds = true;
ship.body.bounce.setTo(0.5, 0.5);
}
function update() {
car.body.velocity.x = 0;
car.body.velocity.y = 0;
car.body.angularVelocity = 0;
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT))
{
car.body.angularVelocity = -200;
}
else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT))
{
car.body.angularVelocity = 200;
}
if (game.input.keyboard.isDown(Phaser.Keyboard.UP))
{
car.body.velocity.copyFrom(game.physics.velocityFromAngle(car.angle, 300));
}
game.physics.collideGroup(aliens);
// total = game.physics.overlap(ship);
}
function render() {
// game.debug.renderQuadTree(game.physics.quadTree);
// game.debug.renderRectangle(ship.body.bounds);
// game.debug.renderText('total: ' + total.length, 32, 50);
// game.debug.renderText('up: ' + ship.body.touching.up, 32, 70);
// game.debug.renderText('down: ' + ship.body.touching.down, 32, 90);
// game.debug.renderText('left: ' + ship.body.touching.left, 32, 110);
// game.debug.renderText('right: ' + ship.body.touching.right, 32, 130);
}
})();
</script>
</body>
</html>
-42
View File
@@ -1,42 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
var game = new Phaser.Game(this, '', 800, 600);
console.log('Host Name:', game.net.getHostName());
console.log('Host Name contains 192:', game.net.checkDomainName('192'));
console.log('Host Name contains google.com:', game.net.checkDomainName('google.com'));
// Add some values to the query string
console.log(game.net.updateQueryString('atari', '520'));
console.log(game.net.updateQueryString('amiga', '1200'));
console.log(game.net.updateQueryString('commodore', '64'));
console.log('Query String: ', game.net.getQueryString());
console.log('Query String Param: ', game.net.getQueryString('atari'));
</script>
<a href="?atari=1&amiga=2&commodore=3">Reload with query string</a>
</body>
</html>
-65
View File
@@ -1,65 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('alien', 'assets/sprites/space-baddie.png');
game.load.image('ship', 'assets/sprites/shmup-ship.png');
}
var player;
var aliens;
function create() {
player = game.add.sprite(400, 500, 'ship');
player.anchor.setTo(0.5, 0.5);
aliens = game.add.group();
for (var y = 0; y < 4; y++)
{
for (var x = 0; x < 10; x++)
{
var alien = aliens.create(200 + x * 48, y * 50, 'alien');
alien.name = 'alien' + x.toString() + y.toString();
alien.events.onOutOfBounds.add(alienOut, this);
alien.body.velocity.y = 50 + Math.random() * 200;
}
}
}
function alienOut(alien) {
// Move the alien to the top of the screen again
alien.reset(alien.x, -32);
// And give it a new random velocity
alien.body.velocity.y = 50 + Math.random() * 200;
}
function update() {
}
function render() {
}
})();
</script>
</body>
</html>
-76
View File
@@ -1,76 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render });
var p;
var p2;
function preload() {
// game.load.image('carrot', 'assets/sprites/carrot.png');
// game.load.image('star', 'assets/misc/star_particle.png');
// game.load.image('diamond', 'assets/sprites/diamond.png');
// game.load.image('dude', 'assets/sprites/phaser-dude.png');
// game.load.image('coke', 'assets/sprites/cokecan.png');
// game.load.atlasJSONHash('pixies', 'assets/sprites/pixi_monsters.png', 'assets/sprites/pixi_monsters.json');
game.load.spritesheet('balls', 'assets/sprites/balls.png', 17, 17);
}
function create() {
game.stage.backgroundColor = 0x337799;
p = game.add.emitter(100, 100, 250);
// p.width = 200;
// p.height = 200;
// keys, frames, quantity, collide
// p.makeParticles(['diamond', 'carrot', 'star']);
p.makeParticles('balls', [0,1,2,3,4,5]);
// p.makeParticles('pixies', [0,1,2,3]);
// p.minParticleScale = 0.1;
// p.maxParticleScale = 0.5;
// Steady constant stream at 250ms delay and 10 seconds lifespan
// p.start(false, 10000, 250, 100);
// p.start(true, 10000);
// explode, lifespan, frequency, quantity
p.minParticleSpeed.setTo(-100, -100);
p.maxParticleSpeed.setTo(100, -200);
p.gravity = 10;
p.start(false, 3000, 10);
game.add.tween(p).to({ x: 700 }, 1000, Phaser.Easing.Quadratic.InOut, true, 0, 1000, true);
}
function update() {
p.y = game.math.min(100, game.input.y);
}
function render() {
}
})();
</script>
</body>
</html>
+22
View File
@@ -0,0 +1,22 @@
body
{
background: #000000;
color: white;
font: 1em/2em Arial, Helvetica;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
padding: 0;
}
* {
user-select: none;
-webkit-tap-highlight-color: rgb(0, 0, 0, 0);
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
+209
View File
@@ -0,0 +1,209 @@
body
{
background: url(assets/suite/background.png);
color: white;
font: 1em/2em Arial, Helvetica;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
padding: 16px;
}
* {
user-select: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
#links {
padding: 16px;
}
:-webkit-full-screen {
width: 100%;
height: 100%;
}
h1 {
font-family: 'Arial', sans-serif;
font-size: 30pt;
margin: 0;
padding: 16px;
text-shadow: 0px 4px 3px rgba(0,0,0,0.4), 0px 8px 13px rgba(0,0,0,0.1), 0px 18px 23px rgba(0,0,0,0.1);
}
h2 {
font-family: 'Arial', sans-serif;
font-size: 20pt;
margin: 16px 0px 16px 0px;
text-shadow: 0px 4px 3px rgba(0,0,0,0.4), 0px 8px 13px rgba(0,0,0,0.1), 0px 18px 23px rgba(0,0,0,0.1);
}
h3 {
font-family: 'Arial', sans-serif;
font-size: 30px;
margin: 16px 0px 16px 16px;
text-shadow: 0px 4px 3px rgba(0,0,0,0.4), 0px 8px 13px rgba(0,0,0,0.1), 0px 18px 23px rgba(0,0,0,0.1);
}
a {
color: yellow;
text-decoration: none;
}
a:Hover {
color: #ffffff;
}
.button
{
display: inline-block;
white-space: nowrap;
background-color: #ccc;
border: 1px solid #777;
padding: 0 1.5em;
margin: 0.5em;
font: bold 1em/2em Arial, Helvetica;
text-decoration: none;
color: #333;
text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
-moz-border-radius: .2em;
-webkit-border-radius: .2em;
border-radius: .2em;
-moz-box-shadow: 0 0 1px 1px rgba(255, 255, 255, .8) inset, 0 1px 0 rgba(0, 0, 0, .3);
-webkit-box-shadow: 0 0 1px 1px rgba(255, 255, 255, .8) inset, 0 1px 0 rgba(0, 0, 0, .3);
box-shadow: 0 0 1px 1px rgba(255, 255, 255, .8) inset, 0 1px 0 rgba(0, 0, 0, .3);
background-image: linear-gradient(top, #eee, #ccc);
}
.button:hover
{
background-color: #ddd;
background-image: linear-gradient(top, #fafafa, #ddd);
}
.button:active
{
-moz-box-shadow: 0 0 4px 2px rgba(0,0,0,.3) inset;
-webkit-box-shadow: 0 0 4px 2px rgba(0,0,0,.3) inset;
box-shadow: 0 0 4px 2px rgba(0,0,0,.3) inset;
position: relative;
top: 1px;
}
.button:focus
{
outline: 0;
background: #fafafa;
}
.button:before
{
background: #ccc;
background: rgba(0,0,0,.1);
float: left;
width: 1em;
text-align: center;
font-size: 1.5em;
margin: 0 1em 0 -1em;
padding: 0 .2em;
-moz-box-shadow: 1px 0 0 rgba(0,0,0,.5), 2px 0 0 rgba(255,255,255,.5);
-webkit-box-shadow: 1px 0 0 rgba(0,0,0,.5), 2px 0 0 rgba(255,255,255,.5);
box-shadow: 1px 0 0 rgba(0,0,0,.5), 2px 0 0 rgba(255,255,255,.5);
-moz-border-radius: .15em 0 0 .15em;
-webkit-border-radius: .15em 0 0 .15em;
border-radius: .15em 0 0 .15em;
pointer-events: none;
}
/* Hexadecimal entities for the icons */
.add:before
{
content: "\271A";
}
.edit:before
{
content: "\270E";
}
.delete:before
{
content: "\2718";
}
.save:before
{
content: "\2714";
}
.email:before
{
content: "\2709";
}
.like:before
{
content: "\2764";
}
.next:before
{
content: "\279C";
}
.star:before
{
content: "\2605";
}
.spark:before
{
content: "\2737";
}
.play:before
{
content: "\25B6";
}
/* Buttons and inputs */
button.button, input.button
{
cursor: pointer;
overflow: visible; /* removes extra side spacing in IE */
}
/* removes extra inner spacing in Firefox */
button::-moz-focus-inner
{
border: 0;
padding: 0;
}
/* If line-height can't be modified, then fix Firefox spacing with padding */
input::-moz-focus-inner
{
padding: .4em;
}
/* The disabled styles */
.button[disabled], .button[disabled]:hover, .button.disabled, .button.disabled:hover
{
background: #eee;
color: #aaa;
border-color: #aaa;
cursor: default;
text-shadow: none;
position: static;
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
-139
View File
@@ -1,139 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/pixi/Pixi.js"></script>
<script src="../src/pixi/InteractionManager.js"></script>
<script src="../src/pixi/core/Circle.js"></script>
<script src="../src/pixi/core/Ellipse.js"></script>
<script src="../src/pixi/core/Matrix.js"></script>
<script src="../src/pixi/core/Point.js"></script>
<script src="../src/pixi/core/Polygon.js"></script>
<script src="../src/pixi/core/Rectangle.js"></script>
<script src="../src/pixi/display/DisplayObject.js"></script>
<script src="../src/pixi/display/DisplayObjectContainer.js"></script>
<script src="../src/pixi/display/Sprite.js"></script>
<script src="../src/pixi/display/MovieClip.js"></script>
<script src="../src/pixi/display/Stage.js"></script>
<script src="../src/pixi/extras/CustomRenderable.js"></script>
<script src="../src/pixi/extras/Strip.js"></script>
<script src="../src/pixi/extras/Rope.js"></script>
<script src="../src/pixi/extras/Spine.js"></script>
<script src="../src/pixi/extras/TilingSprite.js"></script>
<script src="../src/pixi/filters/FilterBlock.js"></script>
<script src="../src/pixi/filters/MaskFilter.js"></script>
<script src="../src/pixi/primitives/Graphics.js"></script>
<script src="../src/pixi/renderers/canvas/CanvasGraphics.js"></script>
<script src="../src/pixi/renderers/canvas/CanvasRenderer.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLBatch.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLGraphics.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLRenderer.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLRenderGroup.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLShaders.js"></script>
<script src="../src/pixi/text/BitmapText.js"></script>
<script src="../src/pixi/text/Text.js"></script>
<script src="../src/pixi/textures/BaseTexture.js"></script>
<script src="../src/pixi/textures/Texture.js"></script>
<script src="../src/pixi/textures/RenderTexture.js"></script>
<script src="../src/pixi/utils/Detector.js"></script>
<script src="../src/pixi/utils/EventTarget.js"></script>
<script src="../src/pixi/utils/Polyk.js"></script>
<script src="../src/pixi/utils/Utils.js"></script>
<script src="../src/system/RequestAnimationFrame.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/math/Math.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/tween/TweenManager.js"></script>
<script src="../src/tween/Tween.js"></script>
<script src="../src/tween/Easing.js"></script>
<script src="../src/time/Time.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
var game = new Phaser.Game(this, '', 800, 600);
// PIXI it
var stage = new PIXI.Stage(0x000044);
var renderer = PIXI.autoDetectRenderer(800, 600);
document.body.appendChild(renderer.view);
game.load.image('cockpit', 'assets/pics/cockpit.png');
game.load.image('rememberMe', 'assets/pics/remember-me.jpg');
game.load.image('overdose', 'assets/pics/lance-overdose-loader_eye.png');
game.load.onLoadStart.add(loadStarted, this);
game.load.onFileComplete.add(fileLoaded, this);
game.load.onLoadComplete.add(loadCompleted, this);
game.load.start();
function loadStarted(size) {
console.log('Loader started, queue size:', size);
}
// this.progress, previousKey, success, this.queueSize - this._keys.length, this.queueSize
function fileLoaded(progress, key, success, remaining, total) {
console.log('File Loaded:', key);
console.log('Progress: ' + progress + '%');
console.log('File: ' + remaining + ' out of ' + total);
}
var bunny;
function loadCompleted() {
console.log('Loader finished, creating base textures');
// Create a basetexture
var base = new PIXI.BaseTexture(game.cache.getImage('overdose'));
var texture = new PIXI.Texture(base);
bunny = new PIXI.Sprite(texture);
// center the sprites anchor point
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
// move the sprite t the center of the screen
bunny.position.x = 200;
bunny.position.y = 150;
stage.addChild(bunny);
requestAnimFrame(animate);
}
function animate() {
requestAnimFrame( animate );
// just for fun, lets rotate mr rabbit a little
bunny.rotation += 0.1;
bunny.scale.x += 0.01;
bunny.scale.y += 0.01;
// render the stage
renderer.render(stage);
}
</script>
</body>
</html>
-44
View File
@@ -1,44 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
<script src="../plugins/SamplePlugin.js"></script>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create });
var plugin;
function preload() {
game.load.image('atari1', 'assets/sprites/atari130xe.png');
}
function create() {
// Create our SamplePlugin.
// All the SamplePlugin does is move a sprite across the screen,
// but it shows how to structure a plugin and hook it into key functions
plugin = game.plugins.add(Phaser.Plugin.SamplePlugin);
var tempSprite = game.add.sprite(0, 200, 'atari1');
plugin.addSprite(tempSprite);
}
})();
</script>
</body>
</html>
-44
View File
@@ -1,44 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/math/Math.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/time/Time.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
var game = new Phaser.Game(this, '', 800, 600);
var a = new Phaser.Point(100, 100);
var b = new Phaser.Point(200, 100);
console.log('Point A', a.toString());
console.log('Point B', b.toString());
a.add(b.x, b.y);
console.log('Point A + B', a.toString());
console.log('Distance between A and B', Phaser.Point.distance(a, b));
</script>
</body>
</html>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Quad Tree";
require('../head.php');
?>
<script type="text/javascript">
@@ -106,5 +101,6 @@
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Quad Tree";
require('../head.php');
?>
<script type="text/javascript">
@@ -20,21 +15,19 @@
}
var ship;
var total;
var aliens;
function create() {
aliens = [];
aliens = game.add.group();
for (var i = 0; i < 50; i++)
{
var s = game.add.sprite(game.world.randomX, game.world.randomY, 'baddie');
var s = aliens.create(game.world.randomX, game.world.randomY, 'baddie')
s.name = 'alien' + s;
s.body.collideWorldBounds = true;
s.body.bounce.setTo(1, 1);
s.body.velocity.setTo(10 + Math.random() * 40, 10 + Math.random() * 40);
aliens.push(s);
}
ship = game.add.sprite(400, 400, 'ship');
@@ -63,8 +56,7 @@
ship.body.velocity.y += 2;
}
game.physics.collideGroup(aliens);
total = game.physics.overlap(ship);
game.physics.collide(ship, aliens);
}
@@ -86,5 +78,6 @@
</script>
</body>
</html>
<?php
require('../foot.php');
?>
-45
View File
@@ -1,45 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/system/RequestAnimationFrame.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/math/Math.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/tween/TweenManager.js"></script>
<script src="../src/tween/Tween.js"></script>
<script src="../src/tween/Easing.js"></script>
<script src="../src/time/Time.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/Parser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<pre id="raf">?</pre>
<pre id="time">Game Time: </pre>
<script type="text/javascript">
var game = new Phaser.Game(this, '', 800, 600, null, null, update);
document.getElementById('raf').innerHTML = 'Browser using requestAnimationFrame: ' + game.raf.isRAF();
function update() {
document.getElementById('time').innerHTML = 'Game Time: ' + game.time.now;
}
</script>
</body>
</html>
-22
View File
@@ -1,22 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
var game = new Phaser.Game();
var r = new Phaser.Rectangle(0,0,100,100);
console.log(r);
</script>
</body>
</html>
-42
View File
@@ -1,42 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, render: render });
function preload() {
game.load.image('atari1', 'assets/sprites/atari130xe.png');
}
function create() {
var tempSprite = game.add.sprite(0, 0, 'atari1');
tempSprite.visible = false;
var renderTexture = game.add.renderTexture('fuji', 320, 200);
renderTexture.render(tempSprite);
var texturedSprite = game.add.sprite(400, 300, renderTexture);
}
function render() {
}
})();
</script>
</body>
</html>
-25
View File
@@ -1,25 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
var game = new Phaser.Game(this, '', 800, 600);
console.log(game.rnd.integer());
console.log(game.rnd.frac());
console.log(game.rnd.real());
console.log(game.rnd.integerInRange(100,200));
</script>
</body>
</html>
-35
View File
@@ -1,35 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a(nother) new beginning</title>
<script src="../src/Phaser.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/Game.js"></script>
</head>
<body>
<script type="text/javascript">
function action(aString, aNumber, aObject) {
console.log('Signal received:', aString, aNumber, aObject);
}
var game = new Phaser.Game(this, '', 800, 600);
// create a new signal
var s = new Phaser.Signal();
// add a listener to it (the 'action' function)
s.add(action, this);
// dispatch it with some parameters
s.dispatch('Atari forever', 520, { x: 100, y: 200 });
</script>
</body>
</html>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Display a Sprite";
require('../head.php');
?>
<script type="text/javascript">
@@ -14,21 +9,13 @@
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });
var bunny;
function preload() {
game.load.image('mushroom', 'assets/sprites/mushroom2.png');
}
function create() {
var test = new Phaser.Sprite(game, 0, 0, 'mushroom');
test.x = 200;
game.world.add(test);
console.log(test.alpha);
var test = game.add.sprite(200, 200, 'mushroom');
}
@@ -39,5 +26,6 @@
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Sprite Sheet";
require('../head.php');
?>
<script type="text/javascript">
@@ -51,5 +46,6 @@
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Sprite Sheet and Scale";
require('../head.php');
?>
<script type="text/javascript">
@@ -61,5 +56,6 @@
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Sprite Animation";
require('../head.php');
?>
<script type="text/javascript">
@@ -66,5 +61,6 @@
</script>
</body>
</html>
<?php
require('../foot.php');
?>
@@ -1,12 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<?php
$title = "Custom Sprite";
require('../head.php');
?>
<script type="text/javascript">
@@ -52,5 +47,6 @@ MonsterBunny.prototype.update = function() {
})();
</script>
</body>
</html>
<?php
require('../foot.php');
?>
-55
View File
@@ -1,55 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }, false, true);
var bunny;
function preload() {
game.load.image('bunny', 'assets/sprites/bunny.png');
}
function create() {
var base = new PIXI.BaseTexture(game.cache.getImage('bunny'));
var texture = new PIXI.Texture(base);
bunny = new PIXI.Sprite(texture);
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
bunny.position.x = game.world.centerX;
bunny.position.y = game.world.centerY;
game.world.add(bunny);
}
function update() {
if (game.paused == false)
{
bunny.rotation += 0.01;
// bunny.scale.x += 0.01;
// bunny.scale.y += 0.01;
}
}
})();
</script>
</body>
</html>
-66
View File
@@ -1,66 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }, false, true);
var bunny;
function preload() {
game.load.atlasJSONHash('monsters', 'assets/sprites/pixi_monsters.png', 'assets/sprites/pixi_monsters.json');
}
function create() {
// This is created by the very act of loading a texture atlas in
frameData = game.cache.getFrameData('monsters');
// Both of these work - they look fugly I know, but they'll be hidden behind a Phaser Sprite anyway
bunny = PIXI.Sprite.fromFrame(frameData.getFrame(0).uuid);
// bunny = PIXI.Sprite.fromFrame(frameData.getFrameByName('skully.png').uuid);
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
bunny.position.x = game.world.centerX;
bunny.position.y = game.world.centerY;
game.world.add(bunny);
n = game.time.now + 1000;
}
var frameData;
var f = 0;
var n = 0;
function update() {
if (game.time.now > n)
{
f = game.math.wrapValue(f, 1, 4);
bunny.setTexture(PIXI.TextureCache[frameData.getFrame(f).uuid]);
n = game.time.now + 500;
}
}
})();
</script>
</body>
</html>
-68
View File
@@ -1,68 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update }, false, false);
var bunny;
function preload() {
game.load.spritesheet('metalslug', 'assets/sprites/metalslug_monster39x40.png', 39, 40);
}
function create() {
// This is created by the very act of loading a sprite sheet in
frameData = game.cache.getFrameData('metalslug');
// Both of these work - they look fugly I know, but they'll be hidden behind a Phaser Sprite anyway
bunny = PIXI.Sprite.fromFrame(frameData.getFrame(0).uuid);
bunny.anchor.x = 0.5;
bunny.anchor.y = 0.5;
bunny.scale.x = 6;
bunny.scale.y = 6;
bunny.position.x = game.world.centerX;
bunny.position.y = game.world.centerY;
game.world.add(bunny);
n = game.time.now + 20;
}
var frameData;
var f = 0;
var n = 0;
function update() {
if (game.time.now > n)
{
f = game.math.wrapValue(f, 1, frameData.total);
bunny.setTexture(PIXI.TextureCache[frameData.getFrame(f).uuid]);
n = game.time.now + 40;
}
}
})();
</script>
</body>
</html>
-31
View File
@@ -1,31 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { create: create });
function create() {
// You can set the stage color using a hex value:
game.stage.backgroundColor = '#550000';
// Or a direct color value:
game.stage.backgroundColor = 0xbbaa44;
}
})();
</script>
</body>
</html>
-40
View File
@@ -1,40 +0,0 @@
TestGame.Game = function (game) {
this.game = game;
};
TestGame.Game.prototype = {
preload: function () {
this.game.load.spritesheet('balls', '../assets/sprites/balls.png', 17, 17);
},
create: function () {
this.game.add.sprite(this.game.world.centerX, this.game.world.centerY, 'cougar').anchor.setTo(0.5, 0.5);
p = this.game.add.emitter(100, 100, 250);
p.makeParticles('balls', [0,1,2,3,4,5]);
p.minParticleSpeed.setTo(-100, -100);
p.maxParticleSpeed.setTo(100, -200);
p.gravity = 10;
p.start(false, 3000, 10);
this.game.add.tween(p).to({ x: 700 }, 1000, Phaser.Easing.Quadratic.InOut, true, 0, 1000, true);
this.game.input.onDown.add(this.quitToMenu, this);
},
quitToMenu: function () {
console.log('lets quit! back to the main menu');
this.game.state.start('mainmenu');
}
}
-30
View File
@@ -1,30 +0,0 @@
TestGame.MainMenu = function (game) {
// Our main menu
this.game = game;
};
TestGame.MainMenu.prototype = {
create: function () {
var bg = this.game.add.sprite(0, 100, 'nocooper');
bg.scale.setTo(2.5, 2.5);
var t = this.game.add.sprite(100, 600, 'touhou');
t.anchor.setTo(0, 1);
button = this.game.add.button(this.game.world.centerX, 400, 'button', this.startGame, this, 2, 1, 0);
button.anchor.setTo(0.5, 0.5);
},
startGame: function () {
console.log('lets play');
this.game.state.start('game');
}
}
-28
View File
@@ -1,28 +0,0 @@
var TestGame = {};
TestGame.Preloader = function (game) {
this.game = game;
};
TestGame.Preloader.prototype = {
preload: function () {
this.game.load.image('nocooper', '../assets/pics/1984-nocooper-space.png');
this.game.load.image('touhou', '../assets/pics/aya_touhou_teng_soldier.png');
this.game.load.image('cougar', '../assets/pics/cougar_ihsf.png');
this.game.load.spritesheet('button', '../assets/buttons/button_sprite_sheet.png', 193, 71);
},
create: function () {
console.log('Preloade finished, lets go to the main menu automatically');
this.game.state.start('mainmenu');
}
}
-30
View File
@@ -1,30 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
<script src="Preloader.js"></script>
<script src="MainMenu.js"></script>
<script src="Game.js"></script>
</head>
<body>
<script type="text/javascript">
(function () {
// No parameters given, which means no default state is created or started
var game = new Phaser.Game(800, 600, Phaser.AUTO);
game.state.add('preloader', TestGame.Preloader, true);
game.state.add('mainmenu', TestGame.MainMenu);
game.state.add('game', TestGame.Game);
})();
</script>
</body>
</html>
-109
View File
@@ -1,109 +0,0 @@
<?php
// All JS files in build order. Much easier for debugging
// <xscript src="../../src/pixi/extras/Spine.js"></script> <xscript src="../../src/pixi/display/MovieClip.js"></script>
?>
<script src="../../src/Intro.js"></script>
<script src="../../src/pixi/Pixi.js"></script>
<script src="../../src/Phaser.js"></script>
<script src="../../src/utils/Utils.js"></script>
<script src="../../src/pixi/core/Matrix.js"></script>
<script src="../../src/pixi/core/Point.js"></script>
<script src="../../src/pixi/core/Rectangle.js"></script>
<script src="../../src/pixi/display/DisplayObject.js"></script>
<script src="../../src/pixi/display/DisplayObjectContainer.js"></script>
<script src="../../src/pixi/display/Sprite.js"></script>
<script src="../../src/pixi/display/Stage.js"></script>
<script src="../../src/pixi/extras/CustomRenderable.js"></script>
<script src="../../src/pixi/extras/Strip.js"></script>
<script src="../../src/pixi/extras/Rope.js"></script>
<script src="../../src/pixi/extras/TilingSprite.js"></script>
<script src="../../src/pixi/filters/FilterBlock.js"></script>
<script src="../../src/pixi/filters/MaskFilter.js"></script>
<script src="../../src/pixi/primitives/Graphics.js"></script>
<script src="../../src/pixi/renderers/canvas/CanvasGraphics.js"></script>
<script src="../../src/pixi/renderers/canvas/CanvasRenderer.js"></script>
<script src="../../src/pixi/renderers/webgl/WebGLBatch.js"></script>
<script src="../../src/pixi/renderers/webgl/WebGLGraphics.js"></script>
<script src="../../src/pixi/renderers/webgl/WebGLRenderer.js"></script>
<script src="../../src/pixi/renderers/webgl/WebGLRenderGroup.js"></script>
<script src="../../src/pixi/renderers/webgl/WebGLShaders.js"></script>
<script src="../../src/pixi/text/BitmapText.js"></script>
<script src="../../src/pixi/text/Text.js"></script>
<script src="../../src/pixi/textures/BaseTexture.js"></script>
<script src="../../src/pixi/textures/Texture.js"></script>
<script src="../../src/pixi/textures/RenderTexture.js"></script>
<script src="../../src/pixi/utils/EventTarget.js"></script>
<script src="../../src/pixi/utils/Polyk.js"></script>
<script src="../../src/core/Camera.js"></script>
<script src="../../src/core/State.js"></script>
<script src="../../src/core/StateManager.js"></script>
<script src="../../src/core/LinkedList.js"></script>
<script src="../../src/core/Signal.js"></script>
<script src="../../src/core/SignalBinding.js"></script>
<script src="../../src/core/Plugin.js"></script>
<script src="../../src/core/PluginManager.js"></script>
<script src="../../src/core/Stage.js"></script>
<script src="../../src/core/Group.js"></script>
<script src="../../src/core/World.js"></script>
<script src="../../src/core/Game.js"></script>
<script src="../../src/input/Input.js"></script>
<script src="../../src/input/Keyboard.js"></script>
<script src="../../src/input/Mouse.js"></script>
<script src="../../src/input/MSPointer.js"></script>
<script src="../../src/input/Pointer.js"></script>
<script src="../../src/input/Touch.js"></script>
<script src="../../src/input/InputHandler.js"></script>
<script src="../../src/system/Canvas.js"></script>
<script src="../../src/gameobjects/Events.js"></script>
<script src="../../src/gameobjects/GameObjectFactory.js"></script>
<script src="../../src/gameobjects/Sprite.js"></script>
<script src="../../src/gameobjects/TileSprite.js"></script>
<script src="../../src/gameobjects/Text.js"></script>
<script src="../../src/gameobjects/Button.js"></script>
<script src="../../src/gameobjects/Graphics.js"></script>
<script src="../../src/gameobjects/RenderTexture.js"></script>
<script src="../../src/gameobjects/BitmapText.js"></script>
<script src="../../src/system/Canvas.js"></script>
<script src="../../src/system/StageScaleMode.js"></script>
<script src="../../src/system/Device.js"></script>
<script src="../../src/system/RequestAnimationFrame.js"></script>
<script src="../../src/math/RandomDataGenerator.js"></script>
<script src="../../src/math/Math.js"></script>
<script src="../../src/math/QuadTree.js"></script>
<script src="../../src/geom/Circle.js"></script>
<script src="../../src/geom/Point.js"></script>
<script src="../../src/geom/Rectangle.js"></script>
<script src="../../src/net/Net.js"></script>
<script src="../../src/tween/TweenManager.js"></script>
<script src="../../src/tween/Tween.js"></script>
<script src="../../src/tween/Easing.js"></script>
<script src="../../src/time/Time.js"></script>
<script src="../../src/animation/AnimationManager.js"></script>
<script src="../../src/animation/Animation.js"></script>
<script src="../../src/animation/Frame.js"></script>
<script src="../../src/animation/FrameData.js"></script>
<script src="../../src/animation/Parser.js"></script>
<script src="../../src/loader/Cache.js"></script>
<script src="../../src/loader/Loader.js"></script>
<script src="../../src/loader/Parser.js"></script>
<script src="../../src/sound/Sound.js"></script>
<script src="../../src/sound/SoundManager.js"></script>
<script src="../../src/utils/Debug.js"></script>
<script src="../../src/utils/Color.js"></script>
<script src="../../src/physics/arcade/ArcadePhysics.js"></script>
<script src="../../src/physics/arcade/Body.js"></script>
<script src="../../src/particles/Particles.js"></script>
<script src="../../src/particles/arcade/ArcadeParticles.js"></script>
<script src="../../src/particles/arcade/Emitter.js"></script>
<script src="../../src/tilemap/Tilemap.js"></script>
<script src="../../src/tilemap/TilemapLayer.js"></script>
<script src="../../src/tilemap/Tile.js"></script>
<script src="../../src/tilemap/TilemapRenderer.js"></script>

Some files were not shown because too many files have changed in this diff Show More