phaser/examples/particles/zero gravity.php
2013-09-16 01:08:06 +01:00

36 lines
No EOL
728 B
PHP

<?php
$title = "Zero Gravity";
require('../head.php');
?>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create });
function preload() {
game.load.spritesheet('balls', 'assets/sprites/balls.png', 17, 17);
}
function create() {
var emitter = game.add.emitter(game.world.centerX, game.world.centerY, 250);
emitter.makeParticles('balls', [0, 1, 2, 3, 4, 5]);
emitter.minParticleSpeed.setTo(-400, -400);
emitter.maxParticleSpeed.setTo(400, 400);
emitter.gravity = 0;
emitter.start(false, 4000, 15);
}
})();
</script>
<?php
require('../foot.php');
?>