Commit bbb4c9be authored by Chen Jiping's avatar Chen Jiping

优化

parent a33af498
...@@ -1021,7 +1021,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1021,7 +1021,7 @@ export class PlayComponent implements OnInit, OnDestroy {
//小珠 //小珠
const droplet = new MySprite(); const droplet = new MySprite();
droplet.setScaleXY(this.mapScale); droplet.setScaleXY(0.1);
droplet.init(this.images.get("droplet")); droplet.init(this.images.get("droplet"));
droplet.alpha = 0; droplet.alpha = 0;
droplet.x = x; droplet.x = x;
...@@ -1097,7 +1097,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1097,7 +1097,7 @@ export class PlayComponent implements OnInit, OnDestroy {
content_val.textAlign='middle'; content_val.textAlign='middle';
content_val.fontSize = 50; content_val.fontSize = 50;
content_val.fontName = "BRLNSDB"; content_val.fontName = "BRLNSDB";
content_val.fontColor = "#FFFFFF"; content_val.fontColor = "#006400";
content_val.alpha = 0; content_val.alpha = 0;
content_val.refreshSize(); content_val.refreshSize();
...@@ -1109,6 +1109,22 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1109,6 +1109,22 @@ export class PlayComponent implements OnInit, OnDestroy {
content_val.x = - content_val.getBoundingBox().width/2; content_val.x = - content_val.getBoundingBox().width/2;
content_val.y = -20 * this.mapScale; content_val.y = -20 * this.mapScale;
//字中字效果
{
let content_val_2 = new Label();
content_val_2.text = content.val;
content_val_2.textAlign='middle';
content_val_2.fontSize = content_val.fontSize - 4;
content_val_2.fontName = "BRLNSDB";
content_val_2.fontColor = "#FFFFFF";
content_val_2.alpha = 0;
content_val_2.refreshSize();
content_val_2.x = (content_val.getBoundingBox().width - content_val_2.getBoundingBox().width ) / 2;
//content_val_2.y = (content_val.getBoundingBox().height - content_val_2.getBoundingBox().height ) / 2;
content_val.addChild(content_val_2);
content_val.childDepandAlpha = true;
}
lotusLeafObj.conText = content_val; lotusLeafObj.conText = content_val;
parItem.addChild(content_val); parItem.addChild(content_val);
...@@ -1397,7 +1413,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1397,7 +1413,7 @@ export class PlayComponent implements OnInit, OnDestroy {
star.init(this.images.get('star')); star.init(this.images.get('star'));
const randomS = (Math.random() * 1.5 + 0.5) * this.mapScale; const randomS = (Math.random() * 0.5 + 0.3) * this.mapScale;
star.setScaleXY(randomS); star.setScaleXY(randomS);
const randomR = Math.random() * 360; const randomR = Math.random() * 360;
...@@ -1435,7 +1451,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1435,7 +1451,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let lotusLeaf = this.smallLotusLeafs[i]; let lotusLeaf = this.smallLotusLeafs[i];
//显示小水珠 //显示小水珠
lotusLeaf.droplet.alpha = 1; //lotusLeaf.droplet.alpha = 1;
//显示内容 //显示内容
let content; let content;
...@@ -1451,7 +1467,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1451,7 +1467,7 @@ export class PlayComponent implements OnInit, OnDestroy {
tweenChange(content, {alpha:1}, 0.5, ()=>{ tweenChange(content, {alpha:1}, 0.5, ()=>{
//隐藏小水珠 //隐藏小水珠
lotusLeaf.droplet.alpha = 0; //lotusLeaf.droplet.alpha = 0;
}); });
...@@ -1463,13 +1479,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1463,13 +1479,9 @@ export class PlayComponent implements OnInit, OnDestroy {
tweenChange(lotusLeaf.hl, {alpha:0}, 0.5, ()=>{ tweenChange(lotusLeaf.hl, {alpha:0}, 0.5, ()=>{
//显示水珠 //显示水珠
lotusLeaf.droplet.alpha = 1; //lotusLeaf.droplet.alpha = 1;
//最后一次,显示大荷叶
if(i == this.smallLotusLeafs.length - 1){
//显示大荷叶
showBigLotus();
}
}); });
...@@ -1478,6 +1490,15 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1478,6 +1490,15 @@ export class PlayComponent implements OnInit, OnDestroy {
}); });
//最后一次,显示大荷叶
if(i == this.smallLotusLeafs.length - 1){
//显示大荷叶
showBigLotus();
}
//显示小水珠
tweenChange(lotusLeaf.droplet, {alpha :1, scaleX : this.mapScale, scaleY : this.mapScale}, 0.5)
}, 3000); }, 3000);
}); });
} }
...@@ -1485,7 +1506,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1485,7 +1506,7 @@ export class PlayComponent implements OnInit, OnDestroy {
//显示荷叶 //显示荷叶
const showBigLotus = () =>{ const showBigLotus = () =>{
tweenChange(this.bigLotusLeaf.lotusLeaf, {x: this.bigLotusLeaf.initX, y:this.bigLotusLeaf.initY}, 1, ()=>{ tweenChange(this.bigLotusLeaf.lotusLeaf, {x: this.bigLotusLeaf.initX, y:this.bigLotusLeaf.initY}, 0.5, ()=>{
this.toggleBigLotus(); this.toggleBigLotus();
...@@ -1579,21 +1600,27 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1579,21 +1600,27 @@ export class PlayComponent implements OnInit, OnDestroy {
//荷叶放大 //荷叶放大
tweenChange(lotusLeaf.hl, {scaleX:this.mapScale * 1.3, scaleY: this.mapScale * 1.3}, 0.3, () => { tweenChange(lotusLeaf.hl, {scaleX:this.mapScale * 1.3, scaleY: this.mapScale * 1.3}, 0.3, () => {
});
//5秒后恢复原状
setTimeout(() => {
//荷叶缩小 //荷叶缩小
tweenChange(lotusLeaf.hl, {scaleX:this.mapScale, scaleY: this.mapScale}, 0.3, ()=>{ tweenChange(lotusLeaf.hl, {scaleX:this.mapScale, scaleY: this.mapScale}, 0.3, ()=>{
tweenChange(lotusLeaf.hl, {alpha:0}, 0.3, ()=>{ tweenChange(lotusLeaf.hl, {alpha:0}, 0.3, ()=>{
}); });
}); });
});
//阴影放大再缩小
tweenChange(lotusLeaf.shadow, {scaleX:this.mapScale * 1.3, scaleY: this.mapScale * 1.3}, 0.3, () => {
tweenChange(lotusLeaf.shadow, {scaleX:this.mapScale, scaleY: this.mapScale}, 0.3); tweenChange(lotusLeaf.shadow, {scaleX:this.mapScale, scaleY: this.mapScale}, 0.3);
}, 2000);
//阴影放大
tweenChange(lotusLeaf.shadow, {scaleX:this.mapScale * 1.3, scaleY: this.mapScale * 1.3}, 0.3, () => {
}); });
//停留0.1秒,然后跳出 //停留0.1秒,然后跳出
...@@ -1799,10 +1826,12 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1799,10 +1826,12 @@ export class PlayComponent implements OnInit, OnDestroy {
//撒花结束 //撒花结束
this.playEnd = false; this.playEnd = false;
//清除所有的花瓣 //等待所有花瓣落下后才能点击
this.endRenderArr = []; setTimeout(() => {
this.canTouch = true; this.canTouch = true;
}, 2000);
}); });
//显示花瓣 //显示花瓣
......
src/assets/play/petal_10.png

882 Bytes | W: | H:

src/assets/play/petal_10.png

1.35 KB | W: | H:

src/assets/play/petal_10.png
src/assets/play/petal_10.png
src/assets/play/petal_10.png
src/assets/play/petal_10.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/petal_12.png

882 Bytes | W: | H:

src/assets/play/petal_12.png

665 Bytes | W: | H:

src/assets/play/petal_12.png
src/assets/play/petal_12.png
src/assets/play/petal_12.png
src/assets/play/petal_12.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/petal_5.png

665 Bytes | W: | H:

src/assets/play/petal_5.png

882 Bytes | W: | H:

src/assets/play/petal_5.png
src/assets/play/petal_5.png
src/assets/play/petal_5.png
src/assets/play/petal_5.png
  • 2-up
  • Swipe
  • Onion skin
src/assets/play/petal_8.png

1.35 KB | W: | H:

src/assets/play/petal_8.png

882 Bytes | W: | H:

src/assets/play/petal_8.png
src/assets/play/petal_8.png
src/assets/play/petal_8.png
src/assets/play/petal_8.png
  • 2-up
  • Swipe
  • Onion skin
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