JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.3.0/phaser.min.js"></script>

JavaScript

var player,
emitter,
lives = 5;

var game = new Phaser.Game(
800,
600,
Phaser.CANVAS,
    'Game', {
    preload: preload,
    create: create,
    update: update,
    render: render
});

function preload() {
    game.load.image('missile', 'http://images.apple.com/v/iphone-5s/a/images/buystrip_retail_icon.png');
    game.load.image('player', 'http://38.media.tumblr.com/avatar_0714f87e9e76_128.png');
}

function create() {

    game.physics.startSystem(Phaser.Physics.ARCADE);
    game.physics.arcade.gravity.y = 300;
    game.stage.backgroundColor = '#000';
    game.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL; // Maintain aspect ratio

    player = game.add.sprite(game.world.width / 2, game.world.height / 2, 'player');
    player.scale.setTo(0.5, 0.5);
    game.physics.arcade.enable(player);
    player.body.allowGravity = false;

    emitter = game.add.emitter(0, 100, 100);
    emitter.makeParticles('missile');
    emitter.gravity = 200;
    emitter.width = 500;
    emitter.x = game.world.width / 2;
    emitter.y = -300;
    emitter.minRotation = 0;
    emitter.maxRotation = 0;
    emitter.setScale(0.1, 0.5, 0.1, 0.5, 6000, Phaser.Easing.Quintic.Out);
    emitter.start(false, 2000, 500);
}

function update() {

    game.physics.arcade.collide(player, emitter, chec, change, this);

    if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
        player.x -= 4;

    } else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
        player.x += 4;
    }
}

function chec() {}

function change() {
    lives--;
    return false;
}

function render() {
    game.debug.text('Lives: ' + lives, 2, 28, "#00ff00");
}