using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class BackgroundBounce : MonoBehaviour
{
    public List<GameObject> bgImages;
    public List<float> bgSpeeds;
    
    void Update()
    {
        float x = Input.mousePosition.x;
        float y = Input.mousePosition.y;

        for (int i = 0;i < bgImages.Count; i++)
        {

            bgImages[i].transform.position = new Vector2(
                                     (x / Screen.width) * bgSpeeds[i],
                                     (y / Screen.height) * bgSpeeds[i]);
        }
    }
}
