Skip to content
Snippets Groups Projects
Commit e1ed2015 authored by v.bloch's avatar v.bloch
Browse files

merge

parent 0d6e1d59
No related merge requests found
......@@ -19,6 +19,8 @@ public class GenerateMap : MonoBehaviour
public List<GameObject> pUsine = new List<GameObject>();
public int nb_of_plot = 8;
public Object[,] plot=new Object[3,3];
private GameObject player = GameObject.FindGameObjectWithTag("Player");
......@@ -40,6 +42,7 @@ public class GenerateMap : MonoBehaviour
void Start()
{
generateVillage();
}
......
......@@ -18,7 +18,8 @@ public class PlayerMovement : MonoBehaviour
private Vector3 change;
private Animator animator;
public PlayerState currentState;
public int stage = 0;
public GameObject player;
// Start is called before the first frame update
void Start()
......@@ -51,6 +52,47 @@ public class PlayerMovement : MonoBehaviour
pos.x = Mathf.Clamp01(pos.x);
pos.y = Mathf.Clamp01(pos.y);
transform.position = Camera.main.ViewportToWorldPoint(pos);
if (this.GetComponent<PlayerNature>().currentNature >= 100 && stage == 0)
{
GenerateMap.instance.generateBoutique(0, 1, "chaussure");
stage++;
}
else if (stage == 1)
{
GenerateMap.instance.generateUsine(1, 1);
stage++;
}
else if (this.GetComponent<PlayerNature>().currentNature >= 100 && stage == 2)
{
GenerateMap.instance.generateBoutique(0, 2, "baton");
stage++;
}
else if (stage == 3)
{
GenerateMap.instance.generateUsine(1, 2);
stage++;
}
else if (this.GetComponent<PlayerNature>().currentNature >= 100 && stage == 4)
{
GenerateMap.instance.generateBoutique(2, 0, "rechaud");
stage++;
}
else if (stage == 5)
{
GenerateMap.instance.generateUsine(2, 1);
stage++;
}
else if (this.GetComponent<PlayerNature>().currentNature >= 100 && stage == 6)
{
GenerateMap.instance.generateBoutique(0, 0, "tente");
stage++;
}
else if (stage == 7)
{
GenerateMap.instance.generateUsine(1, 0);
stage++;
}
}
void MoveCharacter()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment