How to use the level/config.currEdgeX function in level

To help you get started, we’ve selected a few level 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 devyumao / super-ginger / src / level / Stage.js View on Github external
*/
        this.moveEasing = Phaser.Easing.Linear.None;

        /**
         * 高度
         *
         * @type {number}
         */
        this.height = game.cache.getImage(this.imageName).height;

        /**
         * 当前柱子右沿水平位置
         *
         * @type {number}
         */
        this.currEdgeX = config.currEdgeX;

        /**
         * 最大柱宽
         *
         * @type {number}
         */
        this.maxWidth = this.currEdgeX;

        this.updateMinWidth();

        this.updateFoodProba();

        this.updateSpotMultiple();
        this.updateSpotWidth();

        this._init();
github devyumao / super-ginger / src / level / Hero.js View on Github external
Hero.prototype.setForPlay = function (useTween, cb) {
        var game = this.game;

        var x = config.currEdgeX + this.paddingRight;
        var y = game.height - config.horizon;

        if (useTween) {
            var move = game.add.tween(this.sprite)
                .to({x: x, y: y}, 200, Phaser.Easing.Linear.None);
            move.onComplete.add(
                function () {
                    this.down();
                    cb && cb();
                },
                this
            );
            this._act('walk', true);
            move.start();
        }
        else {