How to use the level/config.initialHorizon 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
Stage.prototype._init = function () {
        var game = this.game;

        // 一根居中的当前柱
        this.curr = game.add.tileSprite(
            (game.width - this.maxWidth) / 2,
            game.height - config.initialHorizon - (this.height - config.horizon),
            this.maxWidth,
            this.height,
            this.imageName
        );
    };
github devyumao / super-ginger / src / level / Hero.js View on Github external
Hero.prototype.change = function (index, temporary) {
        // 更新当前所选序号
        global.setSelected(index, !temporary);

        // 更新各属性
        this.index = index;
        this._initConfig();

        var game = this.game;
        var sprite = this.sprite;
        sprite.x = (game.width + this.width * this.scale) / 2;
        sprite.y = game.height - config.initialHorizon;
        sprite.scale.set(this.scale);

        this.down();

        // 根据英雄超能更新棒棒和平台的属性
        var level = game.state.states.level;
        var stick = level.stick;
        if (stick) {
            // 棒棒速度
            stick.updateSpeed();
            // 棒棒材质
            stick.updateTexture();
            // 额外棒长
            stick.updateExtraLength();
        }
        var stage = level.stage;