Esempio n. 1
0
    void FixedUpdate()
    {
        long currentSecondsCounter = overallStopWatch.getElapsedSeconds();

        if (hasDonePlanetMovement || currentSecondsCounter < MainMain.secondsBeforeRedPlanetMovement)
        {
            return;
        }

        doPlanetMovement();
    }
Esempio n. 2
0
    void FixedUpdate() {   

        if (head == null || myStopWatch.getElapsedSeconds() < secondsBeforeStarting) {
            // gameObject was destroyed or too soon
            return;
        }

        float position_x = transform.position.x;
        float position_z = transform.position.z;

        if (xMoveMinus && position_x < xLowerStopPosition) {
            // phase1
            xMoveMinus = false;
            zMoveMinus = true;
            changeSpeed();
        } else if (zMoveMinus && position_z < zLowerStopPosition) {
            // phase2
            zMoveMinus = false;
            xMovePlus = true;
            changeSpeed();
        } else if (xMovePlus && position_x > xUpperStopPosition) {
            // phase3
            xMovePlus = false;
            zMovePlus = true;
            changeSpeed();
        } else if (zMovePlus && position_z > zUpperStopPosition) {
            // phase4
            zMovePlus = false;
            xMoveMinus = true;
            changeSpeed();
        } 

        if (xMoveMinus) {
            transform.Translate(speed_x_z * new Vector3(0, 0, -1) * Time.deltaTime);
            head.transform.Translate(speed_x_z * new Vector3(0, 0, -1) * Time.deltaTime);
        } else if (zMoveMinus) {
            transform.Translate(speed_x_z * new Vector3(0, -1, 0) * Time.deltaTime);
            head.transform.Translate(speed_x_z * new Vector3(0, -1, 0) * Time.deltaTime);
        } else if (xMovePlus) {
            transform.Translate(speed_x_z * new Vector3(0, 0, 1) * Time.deltaTime);
            head.transform.Translate(speed_x_z * new Vector3(0, 0, 1) * Time.deltaTime);
        } else if (zMovePlus) {
            transform.Translate(speed_x_z * new Vector3(0, 1, 0) * Time.deltaTime);
            head.transform.Translate(speed_x_z * new Vector3(0, 1, 0) * Time.deltaTime);
        }

    }
Esempio n. 3
0
    void FixedUpdate()
    {
        long currentSecondsCounter = myStopWatch.getElapsedSeconds();

        adaptCountdownField(currentSecondsCounter);

        rotateRocket(currentSecondsCounter);

        if (currentSecondsCounter < MainMain.secondsBeforeRocket1Liftoff)
        {
            return;
        }

        moveRocket(currentSecondsCounter);
        accelerateRocket();

        checkIfRocketIsToDestroy();
    }
Esempio n. 4
0
    void FixedUpdate()
    {
        long currentSecondsCounter = overallStopWatch.getElapsedSeconds();

        if (currentSecondsCounter < secondsBeforeSunMovement1)
        {
            return;
        }

        if (!longerSunShiningStopWatch.isRunning() || longerSunShiningStopWatch.execeedesMilliseconds(700))
        {
            longerSunShiningStopWatch.stop();

            float randomIntensity = getRandomIntensity(currentSecondsCounter);

            setColor(randomIntensity);
        }

        moveTheSun(currentSecondsCounter);
    }
Esempio n. 5
0
 void FixedUpdate()
 {
     updateHud(myStopWatch.getElapsedSeconds());
     updateChildrenList();
 }