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

merge

parent 0d6e1d59
Branches
No related merge requests found
...@@ -19,6 +19,8 @@ public class GenerateMap : MonoBehaviour ...@@ -19,6 +19,8 @@ public class GenerateMap : MonoBehaviour
public List<GameObject> pUsine = new List<GameObject>(); public List<GameObject> pUsine = new List<GameObject>();
public int nb_of_plot = 8; public int nb_of_plot = 8;
public Object[,] plot=new Object[3,3]; public Object[,] plot=new Object[3,3];
private GameObject player = GameObject.FindGameObjectWithTag("Player");
...@@ -40,6 +42,7 @@ public class GenerateMap : MonoBehaviour ...@@ -40,6 +42,7 @@ public class GenerateMap : MonoBehaviour
void Start() void Start()
{ {
generateVillage(); generateVillage();
} }
......
...@@ -18,7 +18,8 @@ public class PlayerMovement : MonoBehaviour ...@@ -18,7 +18,8 @@ public class PlayerMovement : MonoBehaviour
private Vector3 change; private Vector3 change;
private Animator animator; private Animator animator;
public PlayerState currentState; public PlayerState currentState;
public int stage = 0;
public GameObject player;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
...@@ -51,6 +52,47 @@ public class PlayerMovement : MonoBehaviour ...@@ -51,6 +52,47 @@ public class PlayerMovement : MonoBehaviour
pos.x = Mathf.Clamp01(pos.x); pos.x = Mathf.Clamp01(pos.x);
pos.y = Mathf.Clamp01(pos.y); pos.y = Mathf.Clamp01(pos.y);
transform.position = Camera.main.ViewportToWorldPoint(pos); 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() 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