// Set reference pointers to the correct objects.
    public void Start()
    {
        // Get the main object reference and ensure core scripts are added.
        GameObject mainObject = GameObject.FindGameObjectsWithTag("MainObject")[0];

        if(GameObject.FindGameObjectsWithTag("MainObject").Length > 1){
            GameObject[] mainObjectList = GameObject.FindGameObjectsWithTag("MainObject");
            for(int i = 0; i < mainObjectList.Length; ++i){
                if(mainObjectList[i].GetComponent<GameStateManager>().objectSaved){
                    mainObject = mainObjectList[i];
                }
            }
        }
        gameStateManagerRef = mainObject.GetComponent<GameStateManager>();
        gameStateManagerRef.EnsureCoreScriptsAdded();

        // Get the global variables reference.
        GameObject gVar = GameObject.FindGameObjectsWithTag("globalVariables")[0];
        globalVariables = gVar.GetComponent<GVariables>();
    }
    void Start()
    {
        // the following is now needed due to the prefab of 'MainObject'
        GameObject mainObject = GameObject.FindGameObjectsWithTag("MainObject")[0];
        gameStateManagerRef = mainObject.GetComponent<GameStateManager>();
        gameStateManagerRef.EnsureCoreScriptsAdded();
        screenManagerRef = mainObject.GetComponent<ScreenManager>();
        soundManagerRef = mainObject.GetComponent<SoundManager>();
        characterControllerRef = GameObject.FindGameObjectWithTag("Player").GetComponent<TWCharacterController>();
        mainCamera = GameObject.FindGameObjectWithTag("MainCamera");

        // get a reference to the tear manager
        tearManager = GameObject.FindGameObjectWithTag("TearManager").GetComponent<TearManager>();

        // get a reference to fold
        fold = GameObject.FindGameObjectWithTag("FoldObject").GetComponent<Fold>();

        LvlGoalCoreRef = GameObject.FindGameObjectWithTag("GoalCore").GetComponent<LvlGoalCore>();

        // Get the global variables reference.
        GameObject gVar = GameObject.FindGameObjectsWithTag("globalVariables")[0];
        globalVariables = gVar.GetComponent<GVariables>();

        // if the goal is on the backside move necessary components by offset to be at correct location.
        if(goalOnBackSide){
            // change the box collider on the goal core
            Vector3 GoalCollider = this.gameObject.GetComponent<BoxCollider>().center;
            GoalCollider = new Vector3(GoalCollider.x, GoalCollider.y, GoalCollider.z + (offset*2f));
            this.gameObject.GetComponent<BoxCollider>().center = GoalCollider;

            // change the graphics child object position
            Vector3 GraphicTrans = transform.FindChild("Graphics").transform.position;
            GraphicTrans = new Vector3(GraphicTrans.x, GraphicTrans.y, GraphicTrans.z + offset);
            transform.FindChild("Graphics").transform.position = GraphicTrans;

            // change the goal core child object.
            Vector3 GoalCoreTrans = transform.FindChild("GoalCore").transform.position;
            GoalCoreTrans = new Vector3(GoalCoreTrans.x, GoalCoreTrans.y, GoalCoreTrans.z + offset);
            transform.FindChild("GoalCore").transform.position = GoalCoreTrans;
        }
        buttonCamera = GameObject.FindGameObjectWithTag("button");
    }
    // Use this for initialization.
    public void Start()
    {
        // Ensures all necessary scripts are added for the MainObject
        gameStateManagerRef = gameObject.GetComponent<GameStateManager>();
        gameStateManagerRef.EnsureCoreScriptsAdded();
        gameStateManagerRef.EnsureScriptAdded("MainMenu");

        if(gameStateManagerRef.gameStartedFromUI){
            activeScreen = gameObject.GetComponent("MainMenu") as MainMenu;
            currentScreenArea = ScreenAreas.MainMenu;
        }
        else{
            // This will not be the active screen, but active screen needs to be initialized.
            activeScreen = gameObject.GetComponent("MainMenu") as MainMenu;
            activeScreen.enabled = false;
            currentScreenArea = ScreenAreas.InGame;
        }

        screenOrientation = ScreenOrientation.Landscape;
        deviceOrientation = DeviceOrientation.LandscapeLeft;

        if(Application.platform.Equals(RuntimePlatform.Android)){
            #if UNITY_ANDROID
            using(AndroidJavaClass unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"),
                    metricsClass = new AndroidJavaClass("android.util.DisplayMetrics")){
                using(AndroidJavaObject metricsInstance = new AndroidJavaObject("android.util.DisplayMetrics"),
                        activityInstance = unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity"),
                        windowManagerInstance = activityInstance.Call<AndroidJavaObject>("getWindowManager"),
                        displayInstance = windowManagerInstance.Call<AndroidJavaObject>("getDefaultDisplay")){
                    displayInstance.Call("getMetrics", metricsInstance);
                    screenResolution.y = metricsInstance.Get<int>("heightPixels");
                    screenResolution.x = metricsInstance.Get<int>("widthPixels");
                    screenSize.x = Screen.width;
                    screenSize.y = Screen.height;
                    Screen.SetResolution((int)screenResolution.x, (int)screenResolution.y, true);
                    deviceOrientation = Input.deviceOrientation;
                }
            }
            #endif
        }
        else{
            // Overall screen resolution must be set initially to screen size for UI, then set to screen resolution while in game.
            screenSize = new Vector2(Screen.width, Screen.height);
            screenResolution = new Vector2(Screen.currentResolution.width, Screen.currentResolution.height);

            if(gameStateManagerRef.inUI){
                Screen.SetResolution((int)screenSize.x, (int)screenSize.y, gameStateManagerRef.fullScreen);
            }

            // Developer started in a level.
            else{
                Screen.SetResolution((int)screenResolution.x, (int)screenResolution.y, gameStateManagerRef.fullScreen);
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        #region initialization
        // NOTICE : DOM
        // the following is now needed
        // due to the prefab of 'MainObject'
        GameObject mainObject = GameObject.FindGameObjectsWithTag("MainObject")[0];

        if (GameObject.FindGameObjectsWithTag("MainObject").Length > 1)
        {
            GameObject[] mainObjectList = GameObject.FindGameObjectsWithTag("MainObject");
            for (int i = 0; i < mainObjectList.Length; ++i)
            {
                if (mainObjectList[i].GetComponent<GameStateManager>().objectSaved)
                    mainObject = mainObjectList[i];
            }
        }

        // Ensures all necessary scripts are added for the MainObject
        gameStateManagerRef = mainObject.GetComponent<GameStateManager>();
        gameStateManagerRef.EnsureCoreScriptsAdded();
        gameStateManagerRef.EnsureScriptAdded("TouchController");
        soundManagerRef = mainObject.GetComponent<SoundManager>();
        screenManagerRef = mainObject.GetComponent<ScreenManager>();

        #region initialize references

        backsidePivotReference = GameObject.Find("backsidepivot");
        coverupPivotReference = GameObject.Find ("coveruppivot");
        tornBacksidePieceReference = GameObject.Find ("tornBacksidePiece");
        //sets the reference of the touchcontroller to the touchcontroller script.
        touchController = mainObject.GetComponent<TouchController>();
        //sets the reference of the backsidesideReference to the backside or "fold"
        backsideReference = backsidePivotReference.transform.FindChild("backside").gameObject;

        backSideInitialColor = backsideReference.GetComponent<MeshRenderer>().material.color;

        //sets the reference of the backsideCollisionReference to the platforms on the back of the paper.
        backsideCollisionReference = GameObject.FindGameObjectsWithTag("FoldPlatform");
        //sets the camera reference to the main camera
        cameraReference = GameObject.Find("Main Camera");
        //sets the player reference to the player
        playerReference = GameObject.Find("Player_Prefab");
        //sets the backgroundTransform to the transform of the background paper.
        origBackground = GameObject.FindGameObjectWithTag("background");
        backgroundTransform = origBackground.transform;
        //sets backgroundBounds to the bounds of the background paper
        backgroundBounds = backgroundTransform.GetComponent<MeshFilter>().mesh.bounds;
        //sets changeMeshScript to the ChangeMeshScript which removes and restores triangles.
        changeMeshScript = this.GetComponent<ChangeMeshScript>();
        tearReference = GameObject.Find("Tear_Manager").GetComponent<TearManager>();
        coverupReference = coverupPivotReference.transform.FindChild("coverup").gameObject;
        tearPaperMesh = GameObject.Find("backside").GetComponent<MeshFilter>().mesh;
        unfoldCollisionReference = GameObject.Find("Player_Prefab").GetComponent<UnfoldCollision>();
        shadowReference = GameObject.Find("shadow");
        rayTraceBlockRef = GameObject.Find("rayTraceBlocker");
        paperBorderInsideRef = GameObject.Find("paper_border_inside");
        paperBorderOutsideRef = GameObject.Find("paper_border_outside");
        worldCollisionRef = mainObject.GetComponent<WorldCollision>();
        backsideTriangles = tearPaperMesh.triangles;
        #endregion

        //sets original position and rotation to its starting position and rotation
        foldOriginalRotation = backsidePivotReference.transform.rotation;
        foldOriginalPosition = backsidePivotReference.transform.position;

        //sets starting position coverup's starting position
        coverupStartingPosition = coverupPivotReference.transform.position;
        //sets coverup's original position to the vector required for the tranforms to work properly
        coverupOriginalPosition = new Vector3(0,0,-3);
        //sets coverup's original rotation to its starting rotation
        coverupOriginalRotation = coverupPivotReference.transform.rotation;

        coverupPrefab = coverupPivotReference.transform;
        foldPrefab = backsidePivotReference.transform;

        //initializes variables to defaults.
        fingerList = new List<Vector2>();
        backgroundObjMax = new Vector2();
        backgroundObjMin = new Vector2();
        posModifier = new Vector3();
        posModLastValid = new Vector3();
        unfoldPosModifier = new Vector3();
        foldTmpZLayer = GVariables.zFoldLayer - 1;
        coverupTmpZLayer = GVariables.zCoverLayer -1;
        prevMousestate = false;
        currMouseState = false;
        firstTouch = false;
        isFolded = false;
        overPlayer = false;
        needsToUnfold = false;
        isOffPaper = true;
        backsideIsInstantiated = false;
        currentlyFolding = false;
        missingTriangles = new List<Vector3>();
        //changeMeshScript.GrabUpdatedPlatforms("FoldPlatform");
        deletedTri = new int[0];
        startingQuadrant = Quadrant.NONE;
        currentQuadrant = Quadrant.NONE;
        foldEdge = Edge.BuildManifoldEdges(backsideReference.GetComponent<MeshFilter>().mesh);
        guiEnable = false;
        blah = false;

        foldInput = false;
        prevFoldInput = false;
        #endregion
    }
    // Use this for initialization
    public virtual void Start()
    {
        GameObject mainObject = GameObject.FindGameObjectsWithTag("MainObject")[0];

        if(GameObject.FindGameObjectsWithTag("MainObject").Length > 1){
            GameObject[] mainObjectList = GameObject.FindGameObjectsWithTag("MainObject");
            for(int i = 0; i < mainObjectList.Length; ++i){
                if(mainObjectList[i].GetComponent<GameStateManager>().objectSaved){
                    mainObject = mainObjectList[i];
                }
            }
        }

        gameStateManagerRef = mainObject.GetComponent<GameStateManager>();
        gameStateManagerRef.EnsureCoreScriptsAdded();

        // GUI elements depend on screen size, NOT RESOLUTION
        START_POS = gameStateManagerRef.GetScreenManager().GetScreenSize();
    }
    // Use this for initialization.
    public void Start()
    {
        // Keeping GameObject component grabbing consistent among classes. - J.T.
        GameObject mainObject = GameObject.FindGameObjectsWithTag("MainObject")[0];

        if(GameObject.FindGameObjectsWithTag("MainObject").Length > 1){
            GameObject[] mainObjectList = GameObject.FindGameObjectsWithTag("MainObject");
            for(int i = 0; i < mainObjectList.Length; ++i){
                if(mainObjectList[i].GetComponent<GameStateManager>().objectSaved){
                    mainObject = mainObjectList[i];
                }
            }
        }

        gameStateManagerRef = mainObject.GetComponent <GameStateManager>();
        gameStateManagerRef.EnsureGameScriptsAdded();
        gameStateManagerRef.EnsureCoreScriptsAdded();
        screenManagerRef = mainObject.GetComponent<ScreenManager>();
        animManagerRef = mainObject.GetComponent<AnimationManager>();
        worldCollisionRef = mainObject.GetComponent<WorldCollision>();
        touchController = gameObject.GetComponent<TouchController>();
        soundManagerRef = gameStateManagerRef.GetSoundManager();
        paperObject = GameObject.FindGameObjectWithTag("background");
        tearBorder = GameObject.FindGameObjectWithTag("DeadSpace");
        foldBorder = GameObject.FindGameObjectWithTag("foldborder");
        unfoldBorder = GameObject.FindGameObjectWithTag("unfoldborder");
        unfoldBlocker = GameObject.FindGameObjectWithTag("RayTraceBlocker");
        moveBorder = GameObject.FindGameObjectWithTag("insideBorder");
        menuButton = GameObject.Find("MenuButton_Prefab");
        restartButton = GameObject.Find("RestartButton_Prefab");
        moveMode = true;
        tearMode = false;
        foldMode = false;
        //Keeping old code here in case something gets broken. - J.T.
        // Ensures all necessary scripts are added for the MainObject.
        /*
        gameStateManagerRef = gameObject.GetComponent<GameStateManager>();
        gameStateManagerRef.EnsureCoreScriptsAdded();
        gameStateManagerRef.EnsureGameScriptsAdded();
        screenManagerRef = gameObject.GetComponent<ScreenManager>();
        animManagerRef = gameObject.GetComponent<AnimationManager>();
        worldCollisionRef = gameObject.GetComponent<WorldCollision>();
        touchController = gameObject.GetComponent<TouchController>();
        */
        idleTriggerLimit = Random.Range (1000, 3000);
        keyDownWatch = new Stopwatch();
        idleKeyWatch = new Stopwatch();
        releaseWatch = new Stopwatch();
        justPressedWatch = new Stopwatch();
        playerBottomCollisionWatch = new Stopwatch();
        idlePlayerWatch = new Stopwatch();

        watchList.Add(keyDownWatch);
        watchList.Add(idleKeyWatch);
        watchList.Add(releaseWatch);
        watchList.Add(justPressedWatch);
        watchList.Add(playerBottomCollisionWatch);
        watchList.Add(idlePlayerWatch);

        wasdRight = KeyCode.D;
        wasdLeft = KeyCode.A;
        arrowRight = KeyCode.RightArrow;
        arrowLeft = KeyCode.LeftArrow;
        keyJump = KeyCode.Space;

        hasHorizontalCollision = false;
        currentDirection = ScreenSide.NONE;
        tornPieceInitiated = false;
        movingTornPiece = false;
    }
    // Use this for initialization
    void Start()
    {
        // Ensures all necessary scripts are added for the MainObject
        gameStateManagerRef = gameObject.GetComponent<GameStateManager>();
        gameStateManagerRef.EnsureCoreScriptsAdded();
        inputManagerRef = gameObject.GetComponent<InputManager>();

        playerObject = GameObject.FindGameObjectWithTag("Player");
        paperObject = GameObject.FindGameObjectWithTag("background");
        backsidePaperObject = GameObject.FindGameObjectWithTag("Fold");

        // by default, player should be facing right
        // since we typically start from the left and head right
        currentDirection = AnimationDirection.RIGHT;

        /*  FILLING IN ALL OF THE ANIMATIONS WITH TEXTURE2D FRAMES */
        List<Texture2D> walkList = new List<Texture2D>();
        PopulateWalkAnimations(walkList);
        walkAnimation = new Animation(walkList, Animation.AnimationState.WALK);

        List<Texture2D> idleList = new List<Texture2D>();
        PopulateIdleAnimations(idleList);
        idleAnimation = new Animation(idleList, Animation.AnimationState.IDLE);

        List<Texture2D> standList = new List<Texture2D>();
        PopulateStandAnimations(standList);
        standAnimation = new Animation(standList, Animation.AnimationState.STAND);

        List<Texture2D> jumpList = new List<Texture2D>();
        PopulateJumpAnimations(jumpList);
        jumpAnimation = new Animation(jumpList, Animation.AnimationState.JUMP);

        List<Texture2D> idleAnimAList = new List<Texture2D>();
        PopulateIdleAnimationA(idleAnimAList);
        idleAnimationA = new Animation(idleAnimAList, Animation.AnimationState.IDLEA);

        List<Texture2D> idleAnimBList = new List<Texture2D>();
        PopulateIdleAnimationB(idleAnimBList);
        idleAnimationB = new Animation(idleAnimBList, Animation.AnimationState.IDLEB);

        List<Texture2D> landWallList = new List<Texture2D>();
        PopulateLandWallAnimation(landWallList);
        landWallAnimation = new Animation(landWallList, Animation.AnimationState.WALKINTOWALL);

        List<Texture2D> slideUpList = new List<Texture2D>();
        PopulateSlideUpAnimation(slideUpList);
        slideUpAnimation = new Animation(slideUpList, Animation.AnimationState.WALKUP);

        List<Texture2D> slideDownList = new List<Texture2D>();
        PopulateSlideDownAnimation(slideDownList);
        slideDownAnimation = new Animation(slideDownList, Animation.AnimationState.WALKDOWN);

        List<Texture2D> deathList = new List<Texture2D>();
        PopulateDeathAnimation(deathList);
        deathAnimation = new Animation(deathList, Animation.AnimationState.DEATH);

        List<Texture2D> openList = new List<Texture2D>();
        PopulateOpenAnimation(openList);
        openAnimation = new Animation(openList, Animation.AnimationState.OPENDOOR);

        List<Texture2D> fallList = new List<Texture2D>();
        PopulateFallAnimation(fallList);
        fallAnimation = new Animation(fallList, Animation.AnimationState.FALL);

        level1FrameList.Add(level1Frame1);
        level1FrameList.Add(level1Frame2);
        level1FrameList.Add(level1Frame3);

        //Load backside textures -> J.C.
        BacksideLevel1FrameList.Add(BacksideLevel1Frame1);
        BacksideLevel1FrameList.Add(BacksideLevel1Frame2);
        BacksideLevel1FrameList.Add(BacksideLevel1Frame3);

        //Add to list storing level background animation -> J.C.
        level2FrameList.Add(level2Frame1);
        level2FrameList.Add(level2Frame2);
        level2FrameList.Add(level2Frame3);

        level3FrameList.Add(level3Frame1);
        level3FrameList.Add(level3Frame2);
        level3FrameList.Add(level3Frame3);

        Backsidelevel3FrameList.Add(Backsidelevel3Frame1);
        Backsidelevel3FrameList.Add(Backsidelevel3Frame2);
        Backsidelevel3FrameList.Add(Backsidelevel3Frame3);

        //Add to list storing level background animation -> J.C.
        level4FrameList.Add(level4Frame1);
        level4FrameList.Add(level4Frame2);
        level4FrameList.Add(level4Frame3);

        //Add to list storing level background animation -> J.C.
        level5FrameList.Add(level5Frame1);
        level5FrameList.Add(level5Frame2);
        level5FrameList.Add(level5Frame3);

        //Add to list storing level background animation -> J.C.
        Backsidelevel5FrameList.Add(Backsidelevel5Frame1);
        Backsidelevel5FrameList.Add(Backsidelevel5Frame2);
        Backsidelevel5FrameList.Add(Backsidelevel5Frame3);

        //Add to list storing level background animation -> J.C.
        level6FrameList.Add(level6Frame1);
        level6FrameList.Add(level6Frame2);
        level6FrameList.Add(level6Frame3);

        //Load backside textures -> J.C.
        BacksideLevel6FrameList.Add(BacksideLevel6Frame1);
        BacksideLevel6FrameList.Add(BacksideLevel6Frame2);
        BacksideLevel6FrameList.Add(BacksideLevel6Frame3);

        //Add to list storing level background animation -> J.C.
        level7FrameList.Add(level7Frame1);
        level7FrameList.Add(level7Frame2);
        level7FrameList.Add(level7Frame3);

        //Load backside textures -> J.C.
        BacksideLevel7FrameList.Add(BacksideLevel7Frame1);
        BacksideLevel7FrameList.Add(BacksideLevel7Frame2);
        BacksideLevel7FrameList.Add(BacksideLevel7Frame3);

        //Add to list storing level background animation -> J.C.
        level8FrameList.Add(level8Frame1);
        level8FrameList.Add(level8Frame2);
        level8FrameList.Add(level8Frame3);

        //Load backside textures -> J.C.
        BacksideLevel8FrameList.Add(BacksideLevel8Frame1);
        BacksideLevel8FrameList.Add(BacksideLevel8Frame2);
        BacksideLevel8FrameList.Add(BacksideLevel8Frame3);

        //Add to list storing level background animation -> J.C.
        level9FrameList.Add(level9Frame1);
        level9FrameList.Add(level9Frame2);
        level9FrameList.Add(level9Frame3);

        //Load backside textures -> J.C.
        BacksideLevel9FrameList.Add(BacksideLevel9Frame1);
        BacksideLevel9FrameList.Add(BacksideLevel9Frame2);
        BacksideLevel9FrameList.Add(BacksideLevel9Frame3);

        //Add to list storing level background animation -> J.C.
        level10FrameList.Add(level10Frame1);
        level10FrameList.Add(level10Frame2);
        level10FrameList.Add(level10Frame3);

        //Load backside textures -> T.R.
        BacksideLevel10FrameList.Add(BacksideLevel10Frame1);
        BacksideLevel10FrameList.Add(BacksideLevel10Frame2);
        BacksideLevel10FrameList.Add(BacksideLevel10Frame3);

        //Add to list storing level background animation -> J.C.
        level11FrameList.Add(level11Frame1);
        level11FrameList.Add(level11Frame2);
        level11FrameList.Add(level11Frame3);

        //Load backside textures -> T.R.
        BacksideLevel11FrameList.Add(BacksideLevel11Frame1);
        BacksideLevel11FrameList.Add(BacksideLevel11Frame2);
        BacksideLevel11FrameList.Add(BacksideLevel11Frame3);

        //Add to list storing level background animation -> J.C.
        level12FrameList.Add(level12Frame1);
        level12FrameList.Add(level12Frame2);
        level12FrameList.Add(level12Frame3);

        //Load backside textures -> T.R.
        BacksideLevel12FrameList.Add(BacksideLevel12Frame1);
        BacksideLevel12FrameList.Add(BacksideLevel12Frame2);
        BacksideLevel12FrameList.Add(BacksideLevel12Frame3);

        //Add to list storing level background animation -> J.C.
        level13FrameList.Add(level13Frame1);
        level13FrameList.Add(level13Frame2);
        level13FrameList.Add(level13Frame3);

        //Load backside textures -> T.R.
        BacksideLevel13FrameList.Add(BacksideLevel13Frame1);
        BacksideLevel13FrameList.Add(BacksideLevel13Frame2);
        BacksideLevel13FrameList.Add(BacksideLevel13Frame3);

        //Add to list storing level background animation -> J.C.
        level14FrameList.Add(level14Frame1);
        level14FrameList.Add(level14Frame2);
        level14FrameList.Add(level14Frame3);

        //Load backside textures -> T.R.
        BacksideLevel14FrameList.Add(BacksideLevel14Frame1);
        BacksideLevel14FrameList.Add(BacksideLevel14Frame2);
        BacksideLevel14FrameList.Add(BacksideLevel14Frame3);

        //Add to list storing level background animation -> J.C.
        level15FrameList.Add(level15Frame1);
        level15FrameList.Add(level15Frame2);
        level15FrameList.Add(level15Frame3);

        //Add to list storing level background animation -> J.C.
        BacksideLevel15FrameList.Add(BacksideLevel15Frame1);
        BacksideLevel15FrameList.Add(BacksideLevel15Frame2);
        BacksideLevel15FrameList.Add(BacksideLevel15Frame3);

        //Add to list storing level background animation -> J.C.
        level16FrameList.Add(level16Frame1);
        level16FrameList.Add(level16Frame2);
        level16FrameList.Add(level16Frame3);

        //Load backside textures -> T.R.
        BacksideLevel16FrameList.Add(BacksideLevel16Frame1);
        BacksideLevel16FrameList.Add(BacksideLevel16Frame2);
        BacksideLevel16FrameList.Add(BacksideLevel16Frame3);

        //Add to list storing level background animation -> J.C.
        level17FrameList.Add(level17Frame1);
        level17FrameList.Add(level17Frame2);
        level17FrameList.Add(level17Frame3);

        //Load backside textures -> T.R.
        BacksideLevel17FrameList.Add(BacksideLevel17Frame1);
        BacksideLevel17FrameList.Add(BacksideLevel17Frame2);
        BacksideLevel17FrameList.Add(BacksideLevel17Frame3);

        //Add to list storing level background animation -> J.C.
        level18FrameList.Add(level18Frame1);
        level18FrameList.Add(level18Frame2);
        level18FrameList.Add(level18Frame3);

        //Load backside textures -> T.R.
        BacksideLevel18FrameList.Add(BacksideLevel18Frame1);
        BacksideLevel18FrameList.Add(BacksideLevel18Frame2);
        BacksideLevel18FrameList.Add(BacksideLevel18Frame3);

        //Add to list storing level background animation -> J.C.
        level19FrameList.Add(level19Frame1);
        level19FrameList.Add(level19Frame2);
        level19FrameList.Add(level19Frame3);

        //Add to list storing level background animation -> J.C.
        level20FrameList.Add(level20Frame1);
        level20FrameList.Add(level20Frame2);
        level20FrameList.Add(level20Frame3);

        //Add to list storing level background animation -> J.C.
        level21FrameList.Add(level21Frame1);
        level21FrameList.Add(level21Frame2);
        level21FrameList.Add(level21Frame3);

        //Add to list storing level background animation -> J.C.
        level22FrameList.Add(level22Frame1);
        level22FrameList.Add(level22Frame2);
        level22FrameList.Add(level22Frame3);

        //Add to list storing level background animation -> J.C.
        level23FrameList.Add(level23Frame1);
        level23FrameList.Add(level23Frame2);
        level23FrameList.Add(level23Frame3);

        //Add to list storing level background animation -> J.C.
        level24FrameList.Add(level24Frame1);
        level24FrameList.Add(level24Frame2);
        level24FrameList.Add(level24Frame3);

        //Add to list storing level background animation -> J.C.
        level25FrameList.Add(level25Frame1);
        level25FrameList.Add(level25Frame2);
        level25FrameList.Add(level25Frame3);

        finalLevel1FrameList.Add(finalLevel1Frame1);
        finalLevel6FrameList.Add(finalLevel6Frame1);
        finalLevel7FrameList.Add(finalLevel7Frame1);
        finalLevel8FrameList.Add(finalLevel8Frame1);
        finalLevel9FrameList.Add(finalLevel9Frame1);

        loadingFrameList.Add(loadingFrame1);
        loadingFrameList.Add(loadingFrame2);
        loadingFrameList.Add(loadingFrame3);
        //douglas -is this coded needed at all? looks like its not used by anything
        allAnimations.Clear();
        allAnimations.Add(slideUpAnimation);
        allAnimations.Add(slideDownAnimation);
        allAnimations.Add(openAnimation);
        allAnimations.Add(deathAnimation);
        allAnimations.Add(landWallAnimation);
        allAnimations.Add(idleAnimationA);
        allAnimations.Add(idleAnimationB);
        allAnimations.Add(walkAnimation);
        allAnimations.Add(standAnimation);
        allAnimations.Add(idleAnimation);
        allAnimations.Add(jumpAnimation);
        currFrame = 0;
        timeToWait = 1 / TRANSITION_FPS;

        currentAnimType = AnimationType.STAND;
        currentAnim = standAnimation;
        firstInGameLoop = true;
        reversed = false;

        //The following is initializes the local tearManagerRef
        if (GameObject.FindGameObjectWithTag("TearManager"))
            TearManagerRef = GameObject.FindGameObjectWithTag("TearManager").GetComponent<TearManager>();
    }