mirror of
https://github.com/wassname/phaser.git
synced 2026-08-07 11:26:10 +08:00
Added lots of particles examples.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?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');
|
||||
?>
|
||||
Reference in New Issue
Block a user