summaryrefslogtreecommitdiff
path: root/Assets/Scripts/ScrollingObject.cs
blob: e2b51e5ce86696e02db6d1febd4c3e5ddba71296 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ScrollingObject : MonoBehaviour {

    private Rigidbody2D rb2d;

	// Use this for initialization
	void Start ()
    {
        rb2d = GetComponent<Rigidbody2D>();
        rb2d.velocity = new Vector2(GameControl.instance.scrollSpeed, 0);
	}
	
	// Update is called once per frame
	void Update () {
		if (GameControl.instance.gameOver == true)
        {
            rb2d.velocity = Vector2.zero;
        }
	}
}