forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f069107
commit 8c9a7c8
Showing
9 changed files
with
293 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
$title = "Click to Burst"; | ||
require('../head.php'); | ||
?> | ||
|
||
<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(0, 0, 200); | ||
|
||
p.makeParticles('diamond'); | ||
|
||
// 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; | ||
|
||
// game.add.tween(p).to({ x: 700 }, 1000, Phaser.Easing.Quadratic.InOut, true, 0, 1000, true); | ||
|
||
game.input.onDown.add(particleBurst, this); | ||
|
||
} | ||
|
||
function particleBurst() { | ||
|
||
p.x = game.input.x; | ||
p.y = game.input.y; | ||
p.start(true, 2000, 10, 10); | ||
|
||
} | ||
|
||
function update() { | ||
|
||
// p.y = game.math.min(100, game.input.y); | ||
|
||
} | ||
|
||
function render() { | ||
} | ||
|
||
})(); | ||
</script> | ||
|
||
<?php | ||
require('../foot.php'); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
$title = "Diamond Burst"; | ||
require('../head.php'); | ||
?> | ||
|
||
<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(game.world.centerX, 200, 200); | ||
|
||
// p.width = 200; | ||
// p.height = 200; | ||
|
||
// keys, frames, quantity, collide | ||
|
||
p.makeParticles('diamond'); | ||
|
||
// 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); | ||
p.start(false, 5000, 20); | ||
|
||
// 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> | ||
|
||
<?php | ||
require('../foot.php'); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
$title = "Random Sprite"; | ||
require('../head.php'); | ||
?> | ||
|
||
<script type="text/javascript"> | ||
|
||
(function () { | ||
|
||
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update, render: render }); | ||
|
||
var emitter; | ||
|
||
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'); | ||
|
||
} | ||
|
||
function create() { | ||
|
||
game.stage.backgroundColor = 0x337799; | ||
|
||
emitter = game.add.emitter(game.world.centerX, 200, 200); | ||
|
||
// Here we're passing an array of image keys. It will pick one at random when emitting a new particle. | ||
emitter.makeParticles(['diamond', 'carrot', 'star']); | ||
|
||
emitter.start(false, 5000, 20); | ||
|
||
} | ||
|
||
function update() { | ||
} | ||
|
||
function render() { | ||
} | ||
|
||
})(); | ||
</script> | ||
|
||
<?php | ||
require('../foot.php'); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters