Commit eccf6925 authored by wildfirecode13's avatar wildfirecode13

1

parent 1399ae5c
No preview for this file type
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -135,7 +135,7 @@
"baseOffset": {
"alias": "底座偏移",
"type": "number",
"default": 500
"default": 262
},
"playerOffset": {
"alias": "角色偏移",
......
/**
* Created by rockyl on 2018/8/16.
*/
import { props } from "../props";
import { Background } from "./Background";
import { Base } from "./Base";
import Block from "./Block";
import {Background} from "./Background";
import { GoldBag } from "./GoldBag";
import { GuideLayer } from "./GuideLayer";
import Player from "./Player";
import {props} from "../props";
import {createSvga, getTextureByName, playSound} from "./utils";
import {Base} from "./Base";
import {GuideLayer} from "./GuideLayer";
import {GoldBag} from "./GoldBag";
import { createSvga, getTextureByName, playSound } from "./utils";
import ObjectPool = engine.ObjectPool;
import { JumpTips } from "./JumpTips";
const PoolName: string = 'gold-bag';
......@@ -37,7 +36,6 @@ export default class GameView extends engine.Container {
baseOffset: number;
scoreAddTipsContainer;
jumpTips
timer;
......@@ -124,11 +122,6 @@ export default class GameView extends engine.Container {
scoreAddTips.text = "+0";
scoreAddTips.x = this.player.x-scoreAddTips.width / 2;
scoreAddTipsContainer.addChild(scoreAddTips);
let jumpTips = this.jumpTips =new JumpTips()
jumpTips.setup()
jumpTips.x=props.jumpTipsOffset.x
frontContainer.addChild(playerShadow);
......@@ -136,7 +129,6 @@ export default class GameView extends engine.Container {
frontContainer.addChild(scoreAddTipsContainer);
frontContainer.addChild(jumpTips);
ObjectPool.recycleObject(PoolName, ObjectPool.getObject(PoolName, {
y: 0,
......@@ -209,7 +201,6 @@ export default class GameView extends engine.Container {
this._playerShadow.y =this.player.y+props.playerShadowOffset;
this.scoreAddTipsContainer.y =this.player.y+props.scoreAddTipsOffset;
this.jumpTips.y =this.player.y+props.jumpTipsOffset.y;
//this.setScoreText("+100")
if (!revive) {
await this.player.playReady();
......@@ -456,9 +447,6 @@ export default class GameView extends engine.Container {
this.scoreAddTipsContainer.y =this.player.y+props.scoreAddTipsOffset;
this.setScoreText(`+${scoreAdd}`)
this.jumpTips.y =this.player.y+props.jumpTipsOffset.y;
this.jumpTips.show()
console.log(score, this._remainToShowGoldBag);
if (this._remainToShowGoldBag <= 0) {
......
/**
* Created by rockyl on 2020-01-21.
*/
import {getTextureByName} from "./utils";
import {props} from "../props";
export class JumpTips extends engine.Container {
private _bg: engine.Image;
private _jumpTipsLabel: engine.Label;
private _minScale: number;
constructor() {
super();
}
setup() {
// const {width, height} = this.stage;
this.width=124;
this.height=93;
let bg = this._bg = new engine.Image(getTextureByName('跳跃提示背景'));
bg.width=this.width;
bg.height=this.height;
bg.anchorX = bg.width / 2;
bg.anchorY = bg.height / 2;
this.addChild(bg);
//this._minScale = width / bg.width;
let jumpTipsLabel = this._jumpTipsLabel = new engine.Label();
jumpTipsLabel.width=this.width;
jumpTipsLabel.height=this.height;
jumpTipsLabel.anchorX = jumpTipsLabel.width / 2;
jumpTipsLabel.anchorY = jumpTipsLabel.height / 2;
jumpTipsLabel.fillColor = "#fc4454";
jumpTipsLabel.textAlign=engine.TEXT_ALIGN.CENTER;
jumpTipsLabel.verticalAlign=engine.VERTICAL_ALIGN.MIDDLE;
jumpTipsLabel.size = 24;
jumpTipsLabel.rotation=-26;
jumpTipsLabel.text = "+00";
jumpTipsLabel.x=0;
jumpTipsLabel.y=0;
this.addChild(jumpTipsLabel);
this.alpha=0;
}
show() {
return new Promise(resolve => {
this._jumpTipsLabel.text=props.jumpTips[parseInt((Math.random()*props.jumpTips.length)+"")]
this.alpha=1;
engine.Tween.get(this, null, null, true)
.wait(800)
.to({alpha: 0}, 200, engine.Ease.cubicInOut)
.call(resolve);
})
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment