jeudi 15 décembre 2016

Changing bricks sprite position everytime I restsrt the game

I am making a brick breaker game in which Bricks are placed as follows : bricks

Now what I want is that whenever I start my new game or restart after game over the bricks should get changed randomly but the position should not change!

Now I am not able to figure that out!

Can anybody help? Should I change the Bricks script or the Inspector itself or both?

This is the bricks script :

public class BricksScript : MonoBehaviour {

    // Use this for initialization
    void Start () {

    }

    // Update is called once per frame
    void Update () {

    }
    void OnCollisionEnter2D(Collision2D col){

        if (col.gameObject.tag == "ball") {
            gameObject.SetActive (false);
        }

    }

}




Aucun commentaire:

Enregistrer un commentaire