Unity2D: How to make spawn object gradually go faster after the player collects 10 points?

Hi, so I was wondering if there was a way to make a spawned object gradually moves/go faster after the player (you the user) collects 10 points. And faster when the player collects another 10 points and so on and so on?

This is my movement script attach to my objects that get spawned in:

public class Movement : MonoBehaviour
  {
   public static int movespeed = 20;
   public Vector3 userDirection = Vector3.right;

public void Update()
 {
    transform.Translate(userDirection * movespeed * Time.deltaTime); 
 }
}

This is my score script attach to my player

public int Score;
public Text ScoreText;

void Start ()
{
	Score = 0;
	SetScoreText ();
}

void OnTriggerEnter2D(Collider2D other)
{
	if (other.gameObject.CompareTag ("Pick Up")) 
	{
		other.gameObject.SetActive (false);
		Score = Score + 1;
		SetScoreText ();
	}
}

void SetScoreText ()
{
	ScoreText.text = "Score: " + Score.ToString ();
} 

And this is my generateEnemy script:

public GameOverManager gameOverManager = null;

[HideInInspector]
public float minBlobSpawnTime = 2;
[HideInInspector]
public float maxBlobSpawnTime = 5;
[HideInInspector]
public bool generateBlobs = true;
[HideInInspector]
public GameObject blobPrefab = null;
[HideInInspector]
public GameObject blobRoot = null;
[HideInInspector]
public float minimumYPosition = -0.425f;
[HideInInspector]
public float maximumYPosition = 0.35f;

[HideInInspector]
public float minDaggerSpawnTime = 2;
[HideInInspector]
public float maxDaggerSpawnTime = 5;
[HideInInspector]
public bool generateDaggers = true;
[HideInInspector]
public GameObject daggerPrefab = null;
[HideInInspector]
public GameObject daggerRoot;
[HideInInspector]
public float minimumXPosition = -11.5f;
[HideInInspector]
public float maximumXPosition = 11.5f;

public Camera camera = null;

// Use this for initialization
void Start ()
{
    generateBlobs = ((generateBlobs) && (blobPrefab != null) && (blobRoot != null));
    generateDaggers = ((generateDaggers) && (daggerPrefab != null) && (daggerRoot != null));

    if (camera == null)
    {
        Debug.LogError("GenerateEnemy: camera is not set in the inspector. Please set and try again.");
        camera = Camera.main;
    }

    if (gameOverManager == null)
    {
        Debug.LogError("GenerateEnemy: gameOverManager not set in the inspector. Please set and try again.");
    }

    if (generateBlobs)
    {
        StartCoroutine(GenerateRandomEnemy(true, blobPrefab, blobRoot, minBlobSpawnTime, maxBlobSpawnTime));
    }

    if (generateDaggers)
    {
        StartCoroutine(GenerateRandomEnemy(false, daggerPrefab, daggerRoot, minDaggerSpawnTime, maxDaggerSpawnTime));
    }
}

// Update is called once per frame
void Update ()
{
    DestroyOffScreenEnemies();
}

// Spawn an enemy
IEnumerator GenerateRandomEnemy(bool generateOnYAxis, GameObject prefab, GameObject root, float minSpawnTime, float maxSpawnTime)
{
    if ((prefab != null) && (gameOverManager != null))
    {
        if (!gameOverManager.GameIsPaused())
        {
            GameObject newEnemy = (GameObject) Instantiate(prefab);
            newEnemy.transform.SetParent(root.transform, true);

            // set this in the prefab instead
            // newEnemy.transform.position = new Vector3(newEnemy.transform.parent.position.x, 0.5f, newEnemy.transform.parent.position.z);

            // or if you want the y position to be random you need to do something like this
            if (generateOnYAxis)
            {
                newEnemy.transform.position = new Vector3(newEnemy.transform.parent.position.x, Random.Range(minimumYPosition, maximumYPosition), newEnemy.transform.parent.position.z);
            }
            else
            {
                newEnemy.transform.position = new Vector3(Random.Range(minimumXPosition, maximumXPosition), newEnemy.transform.parent.position.y, newEnemy.transform.parent.position.z);
            }
        }
    }
    yield return new WaitForSeconds(Random.Range(minSpawnTime, maxSpawnTime));

    StartCoroutine(GenerateRandomEnemy(generateOnYAxis, prefab, root, minSpawnTime, maxSpawnTime));
}

public void DestroyOffScreenEnemies()
{
    GameObject[] enemies = GameObject.FindGameObjectsWithTag("enemy");
    if ((enemies.Length > 0) && (camera != null))
    {
        for  (int i = (enemies.Length - 1); i >= 0; i--)
        {
            // just a precaution
            if ((enemies _!= null) && ((camera.WorldToViewportPoint(enemies*.transform.position).x > 1.03f) ||*_ 

(enemies*.transform.position.y < -6f)))*
{
Destroy(enemies*);*
}
}
* }*
* }*
}
(This script has an generateEnemyCustomEditor script that references it, to show in the inspector)
Thank you :slight_smile:

This code should now works. Please mark as answer if it works for you as well, if not tell me want is wrong and i will try to help

public Text ScoreText;
public AudioClip Coinsound;
public Text Highscoretext;
public GameObject theBadGuy;
public Movement movement;

private int Score;
public int highScore = 0;


void Start () 
{
	Score = 0;
	SetScoreText ();
	if (PlayerPrefs.HasKey ("Highscore")) 
	{
		highScore = PlayerPrefs.GetInt("Highscore");
	}
}
void OnTriggerEnter2D(Collider2D other)
{
	if (other.gameObject.CompareTag ("Pick Up")) {
		other.gameObject.SetActive (false);
		Score = Score + 1;
		if (Score == 10) {
			//change "BadGuy" to the name of your enemy
			theBadGuy = GameObject.Find ("BadGuy");
			movement = theBadGuy.GetComponent<Movement> ();
			movement.movespeed += 10;
		}
		SetScoreText ();
		AudioSource.PlayClipAtPoint (Coinsound, transform.position);

	}
}