Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        stomanager = FindObjectOfType(typeof(StomachGameManager)) as StomachGameManager;
        fm         = FindObjectOfType(typeof(StomachFoodManager)) as StomachFoodManager;
        sm         = FindObjectOfType(typeof(StomachEnzyme)) as StomachEnzyme;

        stomanager.addonefood();

        // choose a random number to choose a color and select the correct images
        index = Random.Range(0, 4);
        wholeRepresentation    = wholeFood [index];
        digestedRepresentation = digestedFood [index];

        // get the spawn location and assign the sprite image.

        //used to be 0.6, 0.85
        spawnLocation             = Random.Range(.4f * Screen.width, .6f * Screen.width);
        parent.transform.position = new Vector3(((spawnLocation * 15f / Screen.width) - 7.5f) * 10f,
                                                (11f - (0f * 11f / Screen.height) - 5.5f) * 10f, 90f);          //old z = -2.0f
        GetComponent <SpriteRenderer>().sprite = wholeRepresentation;
        GetComponent <AudioSource> ().clip     = breakSound;

        soundCounter = 0;
        currentState = 0;
    }
Beispiel #2
0
    /**
     * Use this for initialization
     */
    void Start()
    {
        currentAcidLevel = "neutral";


        // make sure game is not paused
        Time.timeScale  = 1;
        deadcellcounter = 0;

        totalfoodcounter    = 0;
        disolvedfoodcounter = 0;



        // get references
        cellManager   = FindObjectOfType(typeof(CellManager)) as CellManager;
        sFM           = FindObjectOfType(typeof(StomachFoodManager)) as StomachFoodManager;
        endGameScript = FindObjectOfType(typeof(BadgePopupSystem)) as BadgePopupSystem;

        // initialize arrays
        elapsedTime        = new float[cellManager.cellScripts.Length];
        nextCellActionTime = new float[cellManager.cellScripts.Length];
        lastCellState      = new string[cellManager.cellScripts.Length];

        deathsForThisCellInARow = new int[cellManager.cellScripts.Length];


        // populate arrays
        for (int i = 0; i < cellManager.cellScripts.Length; i++)
        {
            nextCellActionTime[i] = Mathf.Infinity;
            elapsedTime[i]        = 0f;
        }
    }
Beispiel #3
0
 /**
  * Use this for initialization
  */
 void Start()
 {
     // get references
     fm             = FindObjectOfType(typeof(StomachFoodManager)) as StomachFoodManager;
     gm             = FindObjectOfType(typeof(StomachGameManager)) as StomachGameManager;
     cm             = FindObjectOfType(typeof(CellManager)) as CellManager;
     stEz           = FindObjectOfType(typeof(StomachEnzyme)) as StomachEnzyme;
     gameOverStatus = 0;
 }
Beispiel #4
0
    /**
     * Use this for initialization
     * Sets all dimenstions relative to screen size
     * Chooses a semi-random starting height for the indicator bar
     */
    void Start()
    {
        gm  = FindObjectOfType(typeof(StomachGameManager)) as StomachGameManager;
        fm  = FindObjectOfType(typeof(StomachFoodManager)) as StomachFoodManager;
        APC = FindObjectOfType(typeof(AcidPipeControl)) as AcidPipeControl;
        BPC = FindObjectOfType(typeof(BasicPipeControl)) as BasicPipeControl;


        // starting level of the current level indicator
        currentLevelHeight = 700;

        currentLevelRect.anchoredPosition = new Vector2(currentLevelRect.anchoredPosition.x, currentLevelHeight);
    }
Beispiel #5
0
    /**
     * Use this for initialization
     */
    void Start()
    {
        /*get references*/
        i               = GetComponent <Image> ();
        gm              = FindObjectOfType(typeof(StomachGameManager)) as StomachGameManager;
        fm              = FindObjectOfType(typeof(StomachFoodManager)) as StomachFoodManager;
        attackTimer     = 0f;
        enzymeAttacking = false;
        zymePosition    = new Vector3(-(1024 - 200) * 0.0651f, -(768 - 100) * 0.0651f, 90f);
        zymeRotation    = Quaternion.Euler(0, 0, 135f);
        zymeEaten       = false;


        audio = GetComponent <AudioSource>();
        enzymeAudioBoolean = false;
    }