Exemplo n.º 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;
    }
Exemplo n.º 2
0
 void Start()
 {
     stomanager = FindObjectOfType(typeof(StomachGameManager)) as StomachGameManager;
     timeMap    = new float[8] {
         2f, 2f, 30f, 2f, 2f, 2f, 40f, 2f
     };
     currentFood = 0;
 }
Exemplo n.º 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;
 }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     AFC         = FindObjectOfType(typeof(AcidFlowControl)) as AcidFlowControl;
     PhB         = FindObjectOfType(typeof(PhBar)) as PhBar;
     sgm         = FindObjectOfType(typeof(StomachGameManager)) as StomachGameManager;
     i           = GetComponent <Image>();
     popup       = false;
     initialTime = Time.time;
     clickCount  = 0;
 }
Exemplo n.º 5
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);
    }
Exemplo n.º 6
0
    /**
     * For initialization
     */
    void Start()
    {
        // find reference to the cell manager
        cellManager = FindObjectOfType(typeof(CellManager)) as CellManager;
        gm          = FindObjectOfType(typeof(StomachGameManager)) as StomachGameManager;
        //MD = FindObjectOfType(typeof(mouseDrag)) as mouseDrag;

        MDC = FindObjectOfType(typeof(mouseDragChild)) as mouseDragChild;

        // calculate button size based on screen size
        buttonSize.x = Screen.width * (186f / 1024f);
        buttonSize.y = Screen.height * (253f / 768f);
    }
Exemplo n.º 7
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;
    }
Exemplo n.º 8
0
    /**
     * For initialization
     */
    void Start()
    {
        // get a reference to the image
        i = GetComponent <Image> ();

//        MD = FindObjectOfType(typeof(mouseDrag)) as mouseDrag;
        MDC             = FindObjectOfType(typeof(mouseDragChild)) as mouseDragChild;
        gm              = FindObjectOfType(typeof(StomachGameManager)) as StomachGameManager;
        burnToDeathTime = gm.TIME_TO_DIE;

        burnTimer = 0;


        audio               = GetComponent <AudioSource>();
        cellAudioBoolean    = new bool[2];
        cellAudioBoolean[0] = false;
        cellAudioBoolean[1] = false;
    }
Exemplo n.º 9
0
    private float acidityLevel;             //!< to hold the acidity level value



    // Use this for initialization
    void Start()
    {
        i  = GetComponent <Image>();
        gm = FindObjectOfType(typeof(StomachGameManager)) as StomachGameManager;
    }