Esempio n. 1
0
 // Initializes the mInstance of the DifficultyCurve.
 public void InitilizeGameDifficulty()
 {
     if (mInstance == null)
     {
         mInstance = this;
     }
 }
Esempio n. 2
0
    void Awake()
    {
        // Setup the Main Camera
        Application.targetFrameRate = 150;
        float distance = transform.position.z - GameplayCamera.transform.position.z;

        ScreenHeight = CameraUtils.FrustumHeightAtDistance(distance, GameplayCamera.fieldOfView);
        ScreenBounds = ScreenHeight * GameplayCamera.aspect * 0.5f;

        // Setup input callbacks
        GameInput.OnTap  += HandleOnTap;
        GameInput.OnHold += HandleOnHold;

        // Initialize the game
        mActiveObjects     = new List <GameObject>();
        mTargetsList       = new Queue <int>();
        mCurrentDifficulty = GetComponentInChildren <DifficultyCurve>();
        mPlayerCharacter   = GetComponentInChildren <PlayerCharacter>();
        mGameStatus        = State.TapToStart;
        mMissedEnemies     = 0;
        Paused             = false;

        // Precalculate Bonus weight sum to avoid calculations each frame.
        for (int i = 0; i < BonusTypes.Length; i++)
        {
            mBonusWeightsSum += BonusTypes[i].weight;
        }
    }
Esempio n. 3
0
	void Awake()
	{
		float distance = transform.position.z - GameplayCamera.transform.position.z;
		ScreenHeight = CameraUtils.FrustumHeightAtDistance( distance, GameplayCamera.fieldOfView );
		ScreenBounds = ScreenHeight * GameplayCamera.aspect * 0.5f;

		GameInput.OnTap += HandleOnTap;
		GameInput.OnSwipe += HandleOnSwipe;
		mActiveEnemies = new List<GameObject>();
		mCurrentDifficulty = GetComponentInChildren<DifficultyCurve>();
		mPlayerCharacter = GetComponentInChildren<PlayerCharacter>();
		mGameStatus = State.TapToStart;
        mGameOverTime = Time.timeSinceLevelLoad;
		mMissedEnemies = 0;
		Paused = false;
	}
Esempio n. 4
0
    void Awake()
    {
        float distance = transform.position.z - GameplayCamera.transform.position.z;

        ScreenHeight = CameraUtils.FrustumHeightAtDistance(distance, GameplayCamera.fieldOfView);
        ScreenBounds = ScreenHeight * GameplayCamera.aspect * 0.5f;

        GameInput.OnTap      += HandleOnTap;
        GameInput.OnSwipe    += HandleOnSwipe;
        GameInput.OnKeyPress += HandleKeyPress;

        //mActiveEnemies = new List<GameObject>();
        mCurrentDifficulty = GetComponentInChildren <DifficultyCurve>();
        mPlayerCharacter   = GetComponentInChildren <PlayerCharacter>();
        mGameStatus        = State.TapToStart;
        mGameOverTime      = Time.timeSinceLevelLoad;
        mMissedEnemies     = 0;
        Paused             = false;
    }
    void Awake()
    {
        //This should only be true when running game from Unity as the game usually loads from the Overworld.
        if (GameObject.Find("UserData(Clone)") == null)
        {
            Instantiate(Resources.Load("Prefabs/UserData"), new Vector3(0, 0, 0), Quaternion.identity);
        }
        float distance = transform.position.z - GameplayCamera.transform.position.z;

        ScreenHeight = CameraUtils.FrustumHeightAtDistance(distance, GameplayCamera.fieldOfView);
        ScreenBounds = ScreenHeight * GameplayCamera.aspect * 0.5f;

        GameInput.OnTap   += HandleOnTap;
        GameInput.OnSwipe += HandleOnSwipe;
        GameInput.OnTilt  += HandleOnTilt;
        mActiveEnemies     = new List <GameObject>();
        mCurrentDifficulty = GetComponentInChildren <DifficultyCurve>();
        mPlayerCharacter   = GetComponentInChildren <PlayerCharacter>();
        mGameStatus        = State.TapToStart;
        mGameOverTime      = Time.timeSinceLevelLoad;
        mMissedEnemies     = 0;
        Paused             = false;
        UserData.ResetLevelPoints();
    }
Esempio n. 6
0
 void Start()
 {
     TextField         = TutorialText.GetComponent <TextMesh>();
     parent            = gameObject.GetComponentInParent <DifficultyCurve>();
     GameLogicInstance = gameObject.GetComponentInParent <GameLogic>();
 }