How to use the phaser-ce.State 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 liip / liip10yearsgame / src / states / YouMadeToTop.js View on Github external
import Phaser from 'phaser-ce'
import config from '../config'
import Keyboard from '../objects/Keyboard'
import { makeGreen } from '../utils'
import Db from '../objects/Db'

export default class extends Phaser.State {
    init(action, finalScore = 300, highScore = 0) {
        this.game.add.plugin(window.PhaserInput.Plugin)

        this.jumpInputs = Keyboard.addKeyboard(this.game)
        this.enterKey = Keyboard.addEnter(this.game)

        this.action = action
        this.finalScore = finalScore
        this.highScore = highScore
        this.db = new Db(this.game)
    }

    create() {
        const game = this.game
        const { width, height } = game
        const { lg, xl, center } = config.text

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