Stars zoom effect in phaser 3

Hi,

I have started using Phase 3 recently to develop small games. I want to make a stars background that continuously zooms in.
Below is the example in pixi.js, but I am trying to achieve it in phaser 3 using particles.

this.star_particle = this.add.particles('star1');

        this.star_emitter = this.star_particle.createEmitter({
            x: 0,
			y: 0,
			// emitZone
			emitZone: {
				source: new Phaser.Geom.Rectangle(-width * 3, 0, width * 7, width, height),
				type: 'random',
				quantity: 1000
			},
			// speedY: { min: 50, max: 70 },
			// speedX: { min: -20, max: 20 },
			// accelerationY: { random: [10, 15] },
			// lifespan
			lifespan: { min: 80000, max: 10000 },
			scale: { random: [0.25, 1] },
			alpha: { random: [0.1, 0.8] },
			gravityY: 0,
			frequency: 10,
			blendMode: 'NORMAL',
			// follow the player at an offiset
			follow: this.player, 
			followOffset: { x: -width * 0.5, y: -height - 100 },
        });

This shows up stars rendering on the canvas but how do I zoom in?

Thanks,

I think something like this can work:

var rect = new Phaser.Geom.Rectangle(0, 0, 800, 600);

particles.createEmitter({
    emitZone: { source: rect, type: 'random', quantity: 1000 },
    accelerationX: (p) => 0.1 * (p.x - rect.centerX),
    accelerationY: (p) => 0.1 * (p.y - rect.centerY),
});

Thanks for the reply. It is looking better.
I am still figuring out particle system in phaser 3. Is it possible to build a first person/ third person game in phaser 3? I have seen many tutorials and read various tutorial but its the 2D view of the game.

Is it possible to build a game like “Run 2” in phaser? The graphics are going to be 2D but I need movements like “UP”, “RIGHT” and “LEFT”, and move the platform towards the camera.

Or if not in phaser 3, then any recommendation to build it in Javascript is appreciated.

Here is the screenshot:
image

Thanks,
Kunal

I’m not sure. There is a 3d camera plugin included in Phaser but I haven’t used it.