Skip to content

Scoring System

What is NewScoreManager?

NewScoreManager handles everything about points:

  • 📊 Current score
  • 🔥 Combo multipliers
  • 🏆 High score
  • ⭐ Achievements/milestones

How Scoring Works

Basic Points

Place shape:
  Base points = Number of cells in shape

  Example:
  ■ ■ ■  = 3 cells = 3 points

  ■ ■
  ■ ■  = 4 cells = 4 points

Line Clear Bonus

Clear 1 line = 100 points
Clear 2 lines = 250 points (not just 200!)
Clear 3 lines = 450 points
Clear 4+ lines = 700+ points

Formula: lines × 100 × (1 + combo_bonus)

Combo System

Combo = Clearing lines multiple turns in a row

Turn 1: Clear 1 line
  → Combo × 1.0 (normal points)

Turn 2: Clear 1 line again
  → Combo × 1.5 (50% bonus!)

Turn 3: Clear 1 line again
  → Combo × 2.0 (double points!)

Turn 4: Don't clear any lines
  → Combo resets to × 1.0

Complete Example

Action: Place 3-cell shape, clear 2 lines, combo ×1.5

Calculation:
  Shape points: 3
  Line bonus: 2 × 100 = 200
  Combo multiply: × 1.5

  Total: (3 + 200) × 1.5 = 304 points!

Combo Multiplier Levels

Combo Level Multiplier Visual Feedback
0-1 turns ×1.0 Normal
2-3 turns ×1.5 "Good!"
4-5 turns ×2.0 "Great!"
6-7 turns ×2.5 "Amazing!"
8+ turns ×3.0 "LEGENDARY!"

Inspector Settings

┌─ NewScoreManager ──────────────┐
│ Current Score: 0               │ ← Live score
│ High Score: 0                  │ ← Best score ever
│ Combo Count: 0                 │ ← Current combo
│                                │
│ Line Clear Base: 100           │ ← Points per line
│ Combo Multipliers:             │
│   [1.0, 1.5, 2.0, 2.5, 3.0]   │
│                                │
│ Score Text: [UI Text]          │ ← Where to display
│ Combo Text: [UI Text]          │
└────────────────────────────────┘

Score Display

Main Score

Large number at top of screen showing current points.

Floating Feedback

Animated text that pops up when you score:

+3 points      ← Shape placed
+100 CLEAR!    ← Line cleared
×1.5 COMBO!    ← Combo active
+450 AMAZING!  ← Multi-line + combo

Events

ScoreManager triggers events:

Event When Use for
OnScoreChanged Any points gained Update UI
OnComboStarted First combo Visual effect
OnComboIncreased Combo continues Sound + effect
OnComboBroken Combo ends Reset visuals
OnHighScore New high score! Celebration

Methods (for programmers)

AddShapePoints(cellCount)

Called when shape placed.

// Example:
ScoreManager.AddShapePoints(3);  // +3 points

AddLineClearPoints(lineCount)

Called when lines cleared.

// Example:
ScoreManager.AddLineClearPoints(2);  
// Adds 200+ points (with combo)

IncrementCombo()

Increase combo counter.

// Called automatically when lines cleared

ResetCombo()

Break the combo.

// Called when turn ends without clearing lines

GetHighScore()

Returns best score.

int best = ScoreManager.GetHighScore();

Floating Feedback System

FloatingFeedbackSequencer

Shows animated score popups:

Queue system:
  Event 1: +3
  Event 2: +100 CLEAR!
  Event 3: ×1.5 COMBO!

Displays them one-by-one with delay

Feedback Types

public enum FeedbackType
{
    Normal,      // White text
    Good,        // Yellow text
    Great,       // Orange text
    Amazing,     // Red text
    Legendary    // Rainbow text!
}

Score Persistence

Saving High Score

// Automatically saved using PlayerPrefs
PlayerPrefs.SetInt("HighScore", score);
PlayerPrefs.Save();

Loading High Score

// Loaded on game start
int saved = PlayerPrefs.GetInt("HighScore", 0);

Customization Examples

Change line values

// In NewScoreManager Inspector:
Line Clear Base: 200  // Was 100
// Now each line worth 200 points

Custom combo multipliers

// In NewScoreManager Inspector:
Combo Multipliers: [1.0, 2.0, 3.0, 5.0, 10.0]
// More aggressive combo scaling!

Add perfect clear bonus

// In NewScoreManager.cs:
public void CheckPerfectClear()
{
    if (Matrix.IsCompletelyEmpty())
    {
        AddBonus(1000);  // Bonus for clearing whole board!
        ShowFeedback("PERFECT CLEAR!", FeedbackType.Legendary);
    }
}

Add milestone achievements

void CheckMilestones(int score)
{
    if (score >= 1000 && !achieved1000)
    {
        ShowFeedback("1000 POINTS!", FeedbackType.Amazing);
        achieved1000 = true;
    }
    // Add more milestones...
}

UI Integration

Score Display Update

void OnScoreChanged(int newScore)
{
    scoreText.text = newScore.ToString();

    // Optional: Animate
    scoreText.transform.DOPunchScale(
        Vector3.one * 0.2f, 
        0.3f
    );
}

Combo Display

void OnComboChanged(int combo)
{
    if (combo > 1)
    {
        comboText.text = $"×{GetMultiplier(combo)} COMBO!";
        comboText.gameObject.SetActive(true);
    }
    else
    {
        comboText.gameObject.SetActive(false);
    }
}

Advanced: Score Prediction

Want to show "potential points" before placing?

public int CalculatePotentialScore(ShapeData shape, int row, int col)
{
    int shapePoints = shape.GetCellCount();
    int potentialLines = Matrix.CountPotentialLines(shape, row, col);
    int linePoints = potentialLines × lineClearBase;
    float multiplier = GetCurrentMultiplier();

    return (int)((shapePoints + linePoints) * multiplier);
}

Display this while dragging!

Performance

  • Score calculations: Instant (simple math)
  • Text updates: Batched (once per frame max)
  • Feedback animations: Pooled (no garbage)

No performance issues! 🚀

What's Next?


Game Design Tip

Combo system is key to engagement! Players love seeing multipliers grow. Tune it to feel rewarding!