Cascading

This commit is contained in:
2025-12-15 03:55:18 +08:00
parent 2a3bcf7423
commit 3d22cb6abf
4 changed files with 5 additions and 6 deletions

View File

@@ -54,8 +54,8 @@ MonoBehaviour:
bombDelay: 0.75 bombDelay: 0.75
bombSelfDelay: 0.25 bombSelfDelay: 0.25
bombRadius: 2 bombRadius: 2
dropHeight: 1 dropHeight: 2
gemSpeed: 0.05 gemSpeed: 0.025
scoreSpeed: 1 scoreSpeed: 1
width: 7 width: 7
height: 7 height: 7

View File

@@ -13,7 +13,7 @@ namespace ScriptableObjects {
public float bombDelay = 0.1f; public float bombDelay = 0.1f;
public float bombSelfDelay = 0.05f; public float bombSelfDelay = 0.05f;
public int bombRadius = 1; public int bombRadius = 1;
public int dropHeight = 1; public float dropHeight = 1;
public float gemSpeed = 0.1f; public float gemSpeed = 0.1f;
public float scoreSpeed = 5; public float scoreSpeed = 5;
public int width; public int width;

View File

@@ -25,8 +25,7 @@ namespace Services {
} }
GemView gemView; GemView gemView;
float randomOffset = Random.Range(1f, 2.5f); Vector2 vector2Position = new Vector2(position.x, position.y + dropHeight);
Vector2 vector2Position = new Vector2(position.x, position.y + dropHeight * randomOffset);
if (this.gemTypeToPools[type].Count > 0) { if (this.gemTypeToPools[type].Count > 0) {
gemView = this.gemTypeToPools[type].Pop(); gemView = this.gemTypeToPools[type].Pop();

View File

@@ -23,7 +23,7 @@ namespace Views {
} }
private async UniTask FallDelay() { private async UniTask FallDelay() {
float randomDelay = Random.Range(0.05f, 0.5f); float randomDelay = 1 * this.gem.Position.y / 100f;
await UniTask.WaitForSeconds(randomDelay); await UniTask.WaitForSeconds(randomDelay);
this.isFalling = true; this.isFalling = true;
} }