Skip to content

Commit 0af2375

Browse files
committed
Home Demo
1 parent 8eb5f13 commit 0af2375

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

demo/app.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ backdrop.height = app.view.height;
1818
backdrop.anchor = { x: 0, y: 0 };
1919
app.stage.addChild(backdrop);
2020

21-
const emitter = PIXI.Particles.from('/demo/assets/star.png', 15);
22-
app.stage.addChild(emitter);
21+
const emitter = PIXI.Particles.from('/demo/assets/star.png', 250);
22+
emitter.life = app.view.width;
23+
emitter.direction = Math.PI * 1.5;
24+
emitter.spread = Math.PI;
25+
emitter.x = app.view.width * 0.5;
26+
emitter.y = app.view.height;
27+
app.stage.addChild(emitter)
2328

2429
let planet = new PIXI.Sprite(tex.planet);
2530
planet.anchor = { x: 0.5, y: 0.5 };
@@ -35,8 +40,6 @@ player.speedMult = 8;
3540
app.stage.addChild(player);
3641

3742
app.ticker.add((deltaTime) => {
38-
emitter.x = planet.x;
39-
emitter.y = planet.y;
4043
emitter.step(deltaTime);
4144
planet.x = (PIXI.clamp(PIXI.Mouse.x, 0, app.view.width) + 0.5) ^ 0;
4245
planet.y = (PIXI.clamp(PIXI.Mouse.y, 0, app.view.height) + 0.5) ^ 0;

0 commit comments

Comments
 (0)