|
@@ -97,13 +97,16 @@
|
|
|
<button @click="onChangeX">X为旋转轴</button>
|
|
|
</view> -->
|
|
|
|
|
|
- <!-- <view style="display: flex;justify-content: space-between;" class="margin-top margin-bottom">
|
|
|
+ <!-- #ifdef H5 -->
|
|
|
+ <view style="display: flex;justify-content: space-between;" class="margin-top margin-bottom">
|
|
|
<button @click="onJumpType(0)">jump</button>
|
|
|
<button @click="onJumpType(1)">left</button>
|
|
|
<button @click="onJumpType(2)">right</button>
|
|
|
<button @click="onJumpType(3)">rLeft</button>
|
|
|
<button @click="onJumpType(4)">rRight</button>
|
|
|
- </view> -->
|
|
|
+ </view>
|
|
|
+ <!-- #endif -->
|
|
|
+
|
|
|
|
|
|
<!-- <view style="display: flex;justify-content: space-around; padding-bottom: 100rpx;">
|
|
|
<view style="font-size: 14px;">t:{{countdown}}</view>
|
|
@@ -281,6 +284,10 @@
|
|
|
* 是否去到下一个关卡
|
|
|
*/
|
|
|
canGoNext: false,
|
|
|
+ /**
|
|
|
+ * 生成的特效
|
|
|
+ */
|
|
|
+ canSpawnTemp: null,
|
|
|
|
|
|
onLogData: '',
|
|
|
|
|
@@ -376,13 +383,22 @@
|
|
|
} else if (e.type == 'stop') {
|
|
|
this.onClearData();
|
|
|
this.actionJumpObj.resetAll();
|
|
|
+
|
|
|
if (this.canOnDraw) {
|
|
|
this.canOnDraw = false;
|
|
|
+ // //这里更新特效
|
|
|
+ // this.onDrawEffect(this.canSpawnTemp);
|
|
|
this.onDraw("tipHit");
|
|
|
}
|
|
|
if (this.canGoNext) {
|
|
|
this.canGoNext = false;
|
|
|
- this.startJumpGame();
|
|
|
+ // //这里更新特效
|
|
|
+ // this.onDrawEffect(this.canSpawnTemp);
|
|
|
+ //绘制新触发状态
|
|
|
+ this.onDraw("normal");
|
|
|
+ setTimeout(() => {
|
|
|
+ this.startJumpGame();
|
|
|
+ }, 500)
|
|
|
}
|
|
|
// console.log('stop');
|
|
|
//这里处理生成下一个
|
|
@@ -678,8 +694,11 @@
|
|
|
let _currentBgStartX = this.index == this.spawnArray.length || type == "normal" ? _drawObj
|
|
|
.bgStartXAllNormal : _drawObj
|
|
|
.bgStartXHasTip;
|
|
|
- // console.log("_drawObj.startX:", _drawObj.startX, _drawObj.width / 2);
|
|
|
|
|
|
+ //最后还要绘制一个
|
|
|
+ if (this.spawnArray[this.spawnArray.length - 1].bTrigger) {
|
|
|
+ _currentBgStartX -= 20;
|
|
|
+ }
|
|
|
//绘制八个位置。如果生成数量不够的话。补上对应的数量
|
|
|
let count = 8 - this.spawnArray.length;
|
|
|
count = Math.ceil(count / 2);
|
|
@@ -717,7 +736,8 @@
|
|
|
|
|
|
|
|
|
this.actionJumpCanvas.save();
|
|
|
- this.actionJumpCanvas.globalAlpha = this.spawnArray[i].bTrigger ? 0.7 : 1;
|
|
|
+ // this.spawnArray[i].bTrigger ? 0.7 : 1;
|
|
|
+ this.actionJumpCanvas.globalAlpha = 1;
|
|
|
this.actionJumpCanvas.scale(this.spawnArray[i].scaleX, 1);
|
|
|
|
|
|
let _currentPos = 0;
|
|
@@ -736,7 +756,7 @@
|
|
|
this.actionJumpCanvas.drawImage(_temp.path, _currentCenterPos - 7.5, 37, 40, 40);
|
|
|
|
|
|
//这里记录一个生成点,后面用于生成特效
|
|
|
- this.effectSpawnPosX = _currentCenterPos - 8;
|
|
|
+ this.effectSpawnPosX = _currentPos;
|
|
|
} else {
|
|
|
_currentPos = (_currentBgStartX + _addData + _pos *
|
|
|
50) * this
|
|
@@ -747,26 +767,38 @@
|
|
|
//计算对应中心点的值
|
|
|
_currentCenterPos = _currentPos + 50 / 2 - 25 / 2;
|
|
|
|
|
|
- //44.5 是取画布中心y点,减去图标本身高的一半的值
|
|
|
- this.actionJumpCanvas.drawImage(_temp.path, _currentCenterPos, 44.5, 25, 25);
|
|
|
+ if (!this.spawnArray[i].bTrigger) {
|
|
|
+ //44.5 是取画布中心y点,减去图标本身高的一半的值
|
|
|
+ this.actionJumpCanvas.drawImage(_temp.path, _currentCenterPos, 44.5, 25, 25);
|
|
|
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
this.actionJumpCanvas.restore();
|
|
|
|
|
|
- if (i == this.spawnArray.length - 1) {
|
|
|
+ let _spawnLength = this.spawnArray.length;
|
|
|
+ if (i == _spawnLength - 1) {
|
|
|
//绘制结束位置
|
|
|
- // console.log("count:", count);
|
|
|
- for (let i = 0; i < count; i++) {
|
|
|
- let _currentEndPos = _currentBgStartX + _addData + (this.spawnArray.length +
|
|
|
+ let _endCount = count + 1;
|
|
|
+ for (let i = 0; i < _endCount; i++) {
|
|
|
+ let _bigDataX = 40;
|
|
|
+ // if (i == 0 && this.spawnArray[_spawnLength - 1].bTrigger) {
|
|
|
+ // let _currentEndPos = (_currentBgStartX + _spawnLength * 90 - _spawnLength * 40) *
|
|
|
+ // this
|
|
|
+ // .spawnArray[i]
|
|
|
+ // .scaleX;
|
|
|
+ // this.actionJumpCanvas.drawImage(this.jumpTipImage.path, _currentEndPos, 0, 90, 114);
|
|
|
+ // _bigDataX = 0;
|
|
|
+ // }
|
|
|
+ if (this.spawnArray[_spawnLength - 1].bTrigger) {
|
|
|
+ _bigDataX = 0;
|
|
|
+ }
|
|
|
+ let _currentEndPos = _currentBgStartX + _bigDataX + (this.spawnArray.length +
|
|
|
i) * 50;
|
|
|
-
|
|
|
- // console.log("end _currentEndPos:", _currentEndPos);
|
|
|
this.actionJumpCanvas.drawImage(this.jumpNormalImage.path, _currentEndPos, 0,
|
|
|
50, 114)
|
|
|
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -858,7 +890,11 @@
|
|
|
if (this.index >= this.spawnArray.length) {
|
|
|
clearInterval(this.countdownInterval);
|
|
|
this.countdownInterval = null;
|
|
|
- this.startJumpGame();
|
|
|
+ //绘制新触发状态
|
|
|
+ this.onDraw("normal");
|
|
|
+ setTimeout(() => {
|
|
|
+ this.startJumpGame();
|
|
|
+ }, 2000)
|
|
|
} else {
|
|
|
//绘制新触发状态
|
|
|
this.onDraw('tipHit');
|
|
@@ -1033,7 +1069,8 @@
|
|
|
//监听跳的状态数据
|
|
|
listenStateDataOfJump(data) {
|
|
|
if (this.isGameOver || !this.bJumpPlay) return;
|
|
|
-
|
|
|
+
|
|
|
+ if (this.spawnArray.length == this.index) return;
|
|
|
let _jumpType = this.getCurrentJumpType();
|
|
|
//初始全部默认状态
|
|
|
let _tempState = [{
|
|
@@ -1180,17 +1217,22 @@
|
|
|
// console.log("bSuccess:", bSuccess);
|
|
|
_temp.bTrigger = true;
|
|
|
this.index++;
|
|
|
- //这里更新特效
|
|
|
- this.onDrawEffect(_temp);
|
|
|
+
|
|
|
+ this.canSpawnTemp = _temp;
|
|
|
+ setTimeout(()=>{
|
|
|
+ //这里更新特效
|
|
|
+ this.onDrawEffect(this.canSpawnTemp);
|
|
|
+ },150);
|
|
|
+
|
|
|
if (this.index >= this.spawnArray.length) {
|
|
|
clearInterval(this.countdownInterval);
|
|
|
this.countdownInterval = null;
|
|
|
this.canGoNext = true;
|
|
|
- this.onDraw("normal");
|
|
|
+ // this.onDraw("normal");
|
|
|
} else {
|
|
|
//绘制新触发状态
|
|
|
this.canOnDraw = true;
|
|
|
- this.onDraw("normal");
|
|
|
+ // this.onDraw("normal");
|
|
|
}
|
|
|
//成功
|
|
|
this.setEliminationCount(1);
|
|
@@ -1292,7 +1334,10 @@
|
|
|
},
|
|
|
|
|
|
onTipLevel() {
|
|
|
- this.$emit("tipLevel");
|
|
|
+ this.$emit("tipLevel", {
|
|
|
+ hiddenType: 'normal'
|
|
|
+ });
|
|
|
+ console.log("**************22");
|
|
|
}
|
|
|
}
|
|
|
}
|