Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
);
};
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;