<repo_name>EpitechAntoineMasson/Global-game-Jam<file_sep>/GGJ/Assets/Script/GameController.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;


    public class GameController : MonoBehaviour
    {
        public TextMesh restartText;
        public TextMesh gameOverText;

        private bool gameOver;
        private bool restart;

        void Start()
        {
            gameOver = false;
            restart = false;
            restartText.text = "";
            gameOverText.text = "";
        }

        void Update()
        {
            if (restart)
            {
                if (Input.GetKeyDown(KeyCode.R))
                { 
                    SceneManager.LoadScene ("GGJ game");
                }
            }
        }

        void FixedUpdate()
        {
            if (gameOver)
            {
                restartText.text = "Press 'R' for Restart";
                restart = true;
            }
        }

        public void GameOver()
        {
            gameOverText.text = "Game Over!";
            gameOver = true;
        }
    }
<file_sep>/GGJ/Assets/Script/ChangeColor.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ChangeColor : MonoBehaviour {

	public Material matofobject;
	public KeyCode colo1;
	public KeyCode colo2;
	public KeyCode colo3;
	public KeyCode colo4;
	
	void Update () {
		if (Input.GetKeyDown (colo3)) {
			matofobject.color = Color.blue;
		} else if (Input.GetKeyDown (colo1)) {
			matofobject.color = Color.green;
		} else if (Input.GetKeyDown (colo4)) {
			matofobject.color = Color.yellow;
		} else if (Input.GetKeyDown (colo2)) {
			matofobject.color = Color.red;
		}
	}
}
<file_sep>/GGJ/Assets/Script/MenuPause.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MenuPause : MonoBehaviour {

    public KeyCode input;
    private bool isPaused = false;
    public GameObject canvas;
    public GameObject scoreCanvas;
	
	// Update is called once per frame
	void Update () {
        if (Input.GetKeyDown(input))
            isPaused = !isPaused;
        if (isPaused)
        {
            Time.timeScale = 0f;
            canvas.SetActive(true);
            scoreCanvas.SetActive(false);
        }
        else
        {
            Time.timeScale = 1.0f;
            canvas.SetActive(false);
            scoreCanvas.SetActive(true);
        }
	}
}
<file_sep>/GGJ/Assets/Script/RandSpawn.cs
﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class RandSpawn : MonoBehaviour {
    public Vector3[] positions;
    public GameObject canvas;
    public GameObject scoreCanvas;
    public AudioSource m_MyAudioSource;

    void Start()
    {
        int randomNumber = Random.Range(0, positions.Length);
        transform.position = positions[randomNumber];
    }

    void Update()
    {
        if (Input.GetKey("escape"))
            Application.Quit();
    }
    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player")
        {
            //canvas.SetActive(true);
            //Destroy(gameObject); Debug.log
            //scoreCanvas.SetActive(false);
            //Destroy(other.gameObject);
            //Time.timeScale = 0f;
            //Application.Quit();
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
        }
        if (other.tag == "Zic")
        {
            m_MyAudioSource.Play();
        }

        if (other.tag == "Wall")
        {
            int randomNumber = Random.Range(0, positions.Length);
            transform.position = positions[randomNumber];
        }
    }
}