How to use the phaser-ce.Particle function in phaser-ce

To help you get started, we’ve selected a few phaser-ce examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JarLowrey / phaser-ui / src / particles / Star.js View on Github external
/*
 * Star
 * ====
 *
 * Individual star paritcles in the background star emitters
 */
import Phaser from 'phaser-ce';
console.log(Phaser)
export default class Star extends Phaser.Particle {

    constructor(game, x, y) {
        super(game, x, y, Star.getTexture(game));

        this.checkWorldBounds = true;
        this.events.onOutOfBounds.add(this.__resetPos, this);
    }

    __resetPos() {
        this.x = this.game.world.width * Math.random();
        this.y = 0;
    }

    static getTexture(game) {
        const radius = 12;

phaser-ce

Phaser CE (Community Edition) is a fast, free and fun HTML5 Game Framework for Desktop and Mobile web browsers.

MIT
Latest version published 2 years ago

Package Health Score

59 / 100
Full package analysis