- objects/bottle.js
forerake(){//跳跃失败前倾动画
this.status ='forerake'
setTimeout(()=>{
if (this.direction==0) {
customAnimation.to(this.obj.rotation,1,{z:-Math.PI/2})
}else{
customAnimation.to(this.obj.rotation,1,{x:-Math.PI/2})
}
setTimeout(()=>{
customAnimation.to(this.obj.position,1,{y:-blockConf.height/2+1.2})
customAnimation.to(this.head.position,0.2,{x:1.125})
customAnimation.to(this.head.position,0.2,{x:0,delay:0.2})
},350)
},200)
}
hypsokinesis(){//跳跃失败后倾动画
this.status ='hypsokinesis'
setTimeout(()=>{
if (this.direction==0) {
customAnimation.to(this.obj.rotation,0.8,{z:-Math.PI/2})
}else{
customAnimation.to(this.obj.rotation,0.8,{x:-Math.PI/2})
}
setTimeout(()=>{
customAnimation.to(this.obj.position,1,{y:-blockConf.height/2+1.2})
customAnimation.to(this.head.position,0.2,{x:1.125})
customAnimation.to(this.head.position,0.2,{x:0,delay:0.2})
},350)
},200)
}
- game-page.js
在游戏结束时调用
this.hit ==3 || this.hit ==4
用
this.bottle.forerake()
this.hit ==5
用
this.bottle.hypsokinesis()
- 开始动画音效:bottle.js
//开始动画
import audioManager from '../modules/audio-manager'
showUp中
audioManager.init.play()