Commit bea870f5 authored by zjz1994's avatar zjz1994

代码暂存

parent 426cdc81
This diff is collapsed.
......@@ -16,7 +16,7 @@ export class Player extends engine.Container{
this._container.addChild(this.playerNode);
this.playerNode.y = this.playery;
this.playerNode.x = pierWidth/2 - 50;
this.playerNode.play();
this.playerNode.stop();
this._container.visible = false;
}
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -52,6 +52,12 @@
"url": "//yun.duiba.com.cn/aurora/assets/a3ce52a41ed53ccfa7ce404dbc10102961c4a805.png",
"uuid": "selected",
"ext": ".png"
},
{
"name": "房子动画",
"url": "//yun.duiba.com.cn/aurora/assets/f55c640d40911934c7c5cf01f4fc1940ffb4e16c.svga",
"uuid": "homeani",
"ext": ".svga"
}
],
"events": {
......
This diff is collapsed.
......@@ -26,6 +26,8 @@ export default class MapData{
};
static eleidx = 1;
static elePool = [];
static anispeed = 860;
static getRy(r){
return this.paddingb+r*(this.itemsize+this.paddingi);
}
......
......@@ -16,6 +16,10 @@ export default class Element extends engine.Container{
this.width = MapData.itemsize;
this.height = MapData.itemsize;
this.anchorX = MapData.itemsize/2;
// this.anchorY = MapData.itemsize/2;
this.anchorY = MapData.itemsize;
this.eimage = new engine.Image();
this.addChild(this.eimage);
this.touch = true;
......@@ -55,7 +59,7 @@ export default class Element extends engine.Container{
this.x = (1 - value) * (1 - value) * this.p1x + 2 * value * (1 - value) * this.c1x + value * value * this.p2x;
this.y = (1 - value) * (1 - value) * this.p1y + 2 * value * (1 - value) * this.c1y + value * value * this.p2y;
var mscale = (1 - value) * (1 - value) * 1 + 2 * value * (1 - value) * 0.6 + value * value * 0;
var mscale = (1 - value) * (1 - value) * 1 + 2 * value * (1 - value) * 0.6 + value * value * 0.35;
this.scaleX = mscale;
this.scaleY = mscale;
}
......@@ -70,7 +74,7 @@ export default class Element extends engine.Container{
//飞到小屋
flyToHome(tx,ty,time){
this.p1x = this.x;
this.p1y = this.y;
this.p1y = this.y+20;
this.c1x = (this.p1x-tx)/4+tx;
this.c1y = ty;
......@@ -78,17 +82,52 @@ export default class Element extends engine.Container{
this.p2x = tx;
this.p2y = ty;
engine.Tween.get(this).to({
scaleX:1.1,
scaleY:1.1
},200)
.to({
scaleX:1.1,
scaleY:0.88
},100)
.to({
scaleX:0.98,
scaleY:0.98,
y:this.y+20
},100)
.call(()=>{
engine.Tween.get(this).to({
factor:1
},time)
},450)
.call(()=>{
let nodeparent:engine.Container = this.parent;
nodeparent&&nodeparent.removeChild(this);
MapData.recoverEle(this);
})
})
}
changePos(){
changePos(tpos:Array<number>){
let nx = this.x;
let ny = this.y;
let tx = tpos[0];
let ty = tpos[1];
let dis = MapData.getDistance([nx,ny],tpos);
let time = Math.ceil(dis/MapData.anispeed*1000);
let pro = new Promise(res=>{
engine.Tween.get(this,{loop:false}).to({
x:tx,
y:ty
},time)
.call(()=>{
console.log("单个移动完毕");
res();
})
})
return pro;
}
}
\ No newline at end of file
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