diff --git a/assets/_Game/Scenes/EndLessScene.scene b/assets/_Game/Scenes/EndLessScene.scene index 4e8554a..4b42a08 100644 --- a/assets/_Game/Scenes/EndLessScene.scene +++ b/assets/_Game/Scenes/EndLessScene.scene @@ -17749,7 +17749,8 @@ }, "weight": 100, "weightStepOnGoal": 0, - "maxWeight": 100 + "maxWeight": 100, + "maxObjects": -1 }, { "__type__": "weightedObject", @@ -17759,7 +17760,8 @@ }, "weight": 0, "weightStepOnGoal": 5, - "maxWeight": 30 + "maxWeight": 30, + "maxObjects": 2 }, { "__type__": "cc.UITransform", @@ -17809,7 +17811,7 @@ "y": -1200, "z": 0 }, - "_timePlay": 120, + "_timePlay": 90, "_startSound": { "__uuid__": "6452248b-259c-4844-b0e1-70f47d69955e", "__expectedType__": "cc.AudioClip" diff --git a/assets/_Game/Scripts/Manager/GameManager.ts b/assets/_Game/Scripts/Manager/GameManager.ts index 6f8ca25..05dc69f 100644 --- a/assets/_Game/Scripts/Manager/GameManager.ts +++ b/assets/_Game/Scripts/Manager/GameManager.ts @@ -74,7 +74,6 @@ export class GameManager extends Component { } private addScore(score: number, type: ScoreType, position: Vec3) { - score = this._isMultiBall ? score * 2 : score; this._score += score; const floatingScore = this._FloatingScorePool.get(this._floatingTextContainer, FloatingText); floatingScore.show(`+${score}`, position, score >= 100 ? 1.5 : 1, score >= 100 ? 1 : 0.7); @@ -124,7 +123,7 @@ export class GameManager extends Component { } public async goal(bonusScore: number, position: Vec3) { - this.addScore(bonusScore, ScoreType.Goal, position); + this.addScore(this._isMultiBall ? bonusScore * 2 : bonusScore, ScoreType.Goal, position); this.setCurrentBallInGame(-1); if (this._currentBallInGame <= 0) { await Utilities.delay(TimeConfig.DelayGoal); diff --git a/assets/_Game/Scripts/Manager/SpawnObjectManager.ts b/assets/_Game/Scripts/Manager/SpawnObjectManager.ts index 6e7320c..48c6091 100644 --- a/assets/_Game/Scripts/Manager/SpawnObjectManager.ts +++ b/assets/_Game/Scripts/Manager/SpawnObjectManager.ts @@ -18,6 +18,8 @@ class weightedObject { public weightStepOnGoal = 0; @property(CCInteger) public maxWeight = 0; + @property(CCInteger) + public maxObjects = -1; } @ccclass('SpawnObjectManager') @@ -67,7 +69,9 @@ export class SpawnObjectManager extends Component { private spawn() { if (Object.keys(this._usedPoints).length == this._spawnPoints.length) return; - var randomPool = Utilities.weightedRandom(this._pools, this._weights); + do { + var [randomPool, index] = Utilities.weightedRandom(this._pools, this._weights); + } while (this._objects[index].maxObjects != -1 && randomPool.countActive >= this._objects[index].maxObjects); do { var randomPoint = this._spawnPoints[randomRangeInt(0, this._spawnPoints.length)]; } while (Object.values(this._usedPoints).indexOf(randomPoint) != -1); diff --git a/assets/_Game/Scripts/UI/UIController.ts b/assets/_Game/Scripts/UI/UIController.ts index 949b35d..27bb412 100644 --- a/assets/_Game/Scripts/UI/UIController.ts +++ b/assets/_Game/Scripts/UI/UIController.ts @@ -68,6 +68,7 @@ export class UIController extends Component { this._overPanel.active = false; break; case GameState.GameOver: + this._buffFx.stop(); this._playing = false; this._overPanel.active = true; this._resultLabel.string = this._scoreLabel.string; diff --git a/assets/_Game/Scripts/Utilities/index.ts b/assets/_Game/Scripts/Utilities/index.ts index ea0ec67..c689345 100644 --- a/assets/_Game/Scripts/Utilities/index.ts +++ b/assets/_Game/Scripts/Utilities/index.ts @@ -27,7 +27,7 @@ export default class Utilities { } } - public static weightedRandom(items: T[], weights: number[]): T { + public static weightedRandom(items: T[], weights: number[]): [T, number] { let i = 0; const weightsClone = [...weights]; for (i = 1; i < weightsClone.length; i++) { @@ -39,6 +39,6 @@ export default class Utilities { for (i = 0; i < weightsClone.length; i++) { if (weightsClone[i] > random) break; } - return items[i]; + return [items[i], i]; } } diff --git a/settings/splash.png b/settings/splash.png new file mode 100644 index 0000000..fd14869 Binary files /dev/null and b/settings/splash.png differ diff --git a/settings/v2/packages/builder.json b/settings/v2/packages/builder.json index 0bd7d4f..015a80c 100644 --- a/settings/v2/packages/builder.json +++ b/settings/v2/packages/builder.json @@ -1,3 +1,10 @@ { - "__version__": "1.3.4" + "__version__": "1.3.4", + "splash-setting": { + "displayRatio": 1, + "totalTime": 2000, + "watermarkLocation": "default", + "autoFit": true, + "url": "C:\\ProgramData\\cocos\\editors\\Creator\\3.7.2\\resources\\app.asar.unpacked\\builtin\\builder\\static\\logo\\logo.png" + } }