|
@@ -410,19 +410,20 @@ const mathTool = {
|
|
|
|
|
|
randomVelocityX(posX) {
|
|
randomVelocityX(posX) {
|
|
if (posX < 0) {
|
|
if (posX < 0) {
|
|
- return this.randomMinMax(100, 500);
|
|
|
|
|
|
+ return this.randomMinMax(100, 400);
|
|
} else if (posX >= 0 && posX < width / 2) {
|
|
} else if (posX >= 0 && posX < width / 2) {
|
|
- return this.randomMinMax(0, 500);
|
|
|
|
|
|
+ return this.randomMinMax(0, 400);
|
|
} else if (posX >= width / 2 && posX < width) {
|
|
} else if (posX >= width / 2 && posX < width) {
|
|
- return this.randomMinMax(-500, 0);
|
|
|
|
|
|
+ return this.randomMinMax(-400, 0);
|
|
} else {
|
|
} else {
|
|
- return this.randomMinMax(-500, -100);
|
|
|
|
|
|
+ return this.randomMinMax(-400, -100);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
randomVelocityY() {
|
|
randomVelocityY() {
|
|
- const myH = height - 480;
|
|
|
|
- return this.randomMinMax(-900 - myH, -850 - myH);
|
|
|
|
|
|
+ const myH = height - 600;
|
|
|
|
+ // 调整范围为原速度的70%左右(根据需要微调)
|
|
|
|
+ return this.randomMinMax(-630 - myH * 0.5, -595 - myH * 0.5);
|
|
},
|
|
},
|
|
|
|
|
|
degCos(deg) {
|
|
degCos(deg) {
|
|
@@ -1179,7 +1180,7 @@ class PlayScene extends Phaser.Scene {
|
|
this.x = null;
|
|
this.x = null;
|
|
this.xx = null;
|
|
this.xx = null;
|
|
this.xxx = null;
|
|
this.xxx = null;
|
|
- this.gravity = 600;
|
|
|
|
|
|
+ this.gravity = 200;
|
|
}
|
|
}
|
|
|
|
|
|
create() {
|
|
create() {
|
|
@@ -1354,24 +1355,24 @@ class PlayScene extends Phaser.Scene {
|
|
|
|
|
|
startFruit() {
|
|
startFruit() {
|
|
|
|
|
|
- // 根据分数动态调整数量:分数越高,生成越多水果
|
|
|
|
- let min = 1;
|
|
|
|
- let max = 1;
|
|
|
|
-
|
|
|
|
- if (this.score >=0 && this.score <30) {
|
|
|
|
- min = 1;
|
|
|
|
- max = 1;
|
|
|
|
- } else if (this.score >=30 && this.score <60) {
|
|
|
|
- min = 1;
|
|
|
|
- max = 2;
|
|
|
|
- }else{
|
|
|
|
- min = 2;
|
|
|
|
- max = 3;
|
|
|
|
- }
|
|
|
|
|
|
+ // 根据分数动态调整数量:分数越高,生成越多水果
|
|
|
|
+ let min = 1;
|
|
|
|
+ let max = 1;
|
|
|
|
+
|
|
|
|
+ if (this.score >= 0 && this.score < 30) {
|
|
|
|
+ min = 1;
|
|
|
|
+ max = 1;
|
|
|
|
+ } else if (this.score >= 30 && this.score < 60) {
|
|
|
|
+ min = 1;
|
|
|
|
+ max = 2;
|
|
|
|
+ } else {
|
|
|
|
+ min = 2;
|
|
|
|
+ max = 3;
|
|
|
|
+ }
|
|
|
|
|
|
- const number = Math.floor(mathTool.randomMinMax(min, max + 1)); // +1是因为randomMinMax的max是 exclusive
|
|
|
|
- const hasBomb = Math.random() > 0.9;
|
|
|
|
- const bombIndex = hasBomb ? Math.floor(Math.random() * number) : -1;
|
|
|
|
|
|
+ const number = Math.floor(mathTool.randomMinMax(min, max + 1)); // +1是因为randomMinMax的max是 exclusive
|
|
|
|
+ const hasBomb = Math.random() > 0.9;
|
|
|
|
+ const bombIndex = hasBomb ? Math.floor(Math.random() * number) : -1;
|
|
|
|
|
|
for (let i = 0; i < number; i++) {
|
|
for (let i = 0; i < number; i++) {
|
|
if (i === bombIndex) {
|
|
if (i === bombIndex) {
|