Пример #1
0
    //the ball has fallen out
    public void fallout()
    {
        if (BallMode.FALL != m_ballMode && m_won == false)
        {
            Debug.Log("FALLOUT" + m_gameScript.getNomStrokes());
            //call the gamescripts fallout start


            m_gameScript.onFallOutStart();

            if (onWaterHitGO)
            {
                GameObject go = (GameObject)
                                Instantiate(onWaterHitGO, transform.position, Quaternion.identity);
                Destroy(go, 2);
            }


            if (m_ballMode != BallMode.WIN)
            {
                m_fallTime = fallTime;
                m_ballMode = BallMode.FALL;
            }
        }
    }
Пример #2
0
    private int scoreBar = 100;                     //Amount of points the player needs for the next ball to spawn

    void Start()
    {
        //Initialization
        countManage = GameObject.Find("Counter Manager");
        cor         = startSpawnSequence(BallMode.get());
        StartCoroutine(cor);
        cor = spawnSequence();
        StartCoroutine(cor);
    }
Пример #3
0
public class InitData : MonoBehaviour {                         //This class will attempt to load the saved high score data on a scene's awake
    //If this fails, then it will save a new file with the default values of 0 and 0
    void Awake()
    {
        //Initialization
        if (DataManager.highScore == null && !DataManager.Load())
        {
            DataManager.Save(0, 0);
        }

        if (BallMode.get() == 0)
        {
            BallMode.set(1);
        }
    }
Пример #4
0
    public void victory()
    {
        m_won = true;
        GetComponent <Rigidbody>().isKinematic = true;
        m_gameScript.onStrokeEnd();
        if (GetComponent <Rigidbody>().isKinematic == false)
        {
            GetComponent <Rigidbody>().velocity        = Vector3.zero;
            GetComponent <Rigidbody>().angularVelocity = Vector3.zero;
        }
        if (m_gameScript)
        {
            m_gameScript.victory();
        }

        m_ballMode = BallMode.WIN;
    }
Пример #5
0
    public void setMode(BallMode bmode)
    {
        BallManager.enterState(bmode.ToString());

        if (m_ballMode == BallMode.WIN)
        {
            if (GetComponent <Rigidbody>())
            {
                GetComponent <Rigidbody>().isKinematic = true;
            }
            m_won = true;
        }
        if (m_won == false)
        {
            m_ballMode = bmode;
        }
    }
Пример #6
0
    public Ball GenerateRandomBall(BallMode mode)
    {
        int start = (int)BallType.Blue;
        int end   = (int)BallType.Ghost + 1;

        int result = Random.Range(start, end);
        // result = 0;
        Ball ball = m_Balls[0];

        m_Balls.RemoveAt(0);

        ball.SetBallType((BallType)result);
        ball.SetBallMode(mode);
        ball.SetBallActive(true);
        ball.LoadSprite(m_BallSprites[result]);

        return(ball);
    }
Пример #7
0
	//the ball has fallen out 
	public void fallout()
	{
		if(BallMode.FALL!=m_ballMode && m_won==false)
		{
			
			Debug.Log("FALLOUT" + m_gameScript.getNomStrokes());
			//call the gamescripts fallout start
			
			
			m_gameScript.onFallOutStart();
			
			if(onWaterHitGO)
			{
				GameObject go = (GameObject)
					Instantiate(onWaterHitGO,transform.position,Quaternion.identity);
				Destroy(go,2);
			}
			
			
			if(m_ballMode!=BallMode.WIN)
			{
				m_fallTime = fallTime;
				m_ballMode = BallMode.FALL;
			}
		}		
	}
Пример #8
0
	public void victory()
	{
		m_won=true;
		GetComponent<Rigidbody>().isKinematic=true;
		m_gameScript.onStrokeEnd();
		if(GetComponent<Rigidbody>().isKinematic==false)
		{
			GetComponent<Rigidbody>().velocity=Vector3.zero;
			GetComponent<Rigidbody>().angularVelocity=Vector3.zero;
		}
		if(m_gameScript)
		{
			m_gameScript.victory();
		}
		
		m_ballMode = BallMode.WIN;
	}
Пример #9
0
	public void setMode(BallMode bmode)
	{
		BallManager.enterState( bmode.ToString() );
		
		
		if(m_ballMode==BallMode.WIN)
		{
			
			if(GetComponent<Rigidbody>())
			{
				GetComponent<Rigidbody>().isKinematic=true;
			}
			m_won=true;
		}
		if(m_won==false)
		{
			m_ballMode = bmode;
			
			
		}
	}
Пример #10
0
 public void chooseOption(int mode)                                          //Sets the selected ball mode before switching scenes
 {
     BallMode.set(mode);
     changeToJuggle();
 }