Added randomized sprite flipping to instantiation of objects and dirt/fluid sprites
This commit is contained in:
@@ -15,7 +15,7 @@ public class DirtScript : MonoBehaviour
|
||||
if(other.gameObject.name == "SprayBottle" && !sprayed)
|
||||
{
|
||||
sprayed = true;
|
||||
Instantiate(Spray, new Vector2(this.transform.position.x, this.transform.position.y), Quaternion.identity);
|
||||
Instantiate(Spray, new Vector2(this.transform.position.x, this.transform.position.y), Quaternion.Euler(Random.Range(0, 2)*180, Random.Range(0, 2)*180, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -106,10 +106,11 @@ public class GameScript : MonoBehaviour
|
||||
|
||||
pickedUpItem = null;
|
||||
|
||||
float sizeChange = Random.Range(0.75f, 1.5f);
|
||||
float sizeChange = Random.Range(0.9f, 1.25f);
|
||||
|
||||
Object.GetComponent<SpriteRenderer>().sprite =
|
||||
ObjectSprites[Random.Range(0, ObjectSprites.Length)];
|
||||
Object.transform.localRotation = Quaternion.Euler(Random.Range(0, 2)*180, Random.Range(0, 2)*180, 0);
|
||||
Object.transform.localScale *= sizeChange;
|
||||
|
||||
Object.AddComponent<BoxCollider2D>();
|
||||
@@ -138,7 +139,7 @@ public class GameScript : MonoBehaviour
|
||||
|
||||
}while(placement.collider == null || placement.collider.gameObject.tag != "Object");
|
||||
|
||||
Instantiate(Dirt, new Vector2(xBound, yBound), Quaternion.identity);
|
||||
Instantiate(Dirt, new Vector2(xBound, yBound), Quaternion.Euler(Random.Range(0, 2)*180, Random.Range(0, 2)*180, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user