Update() public method

public Update ( ) : void
return void
示例#1
0
        public void SwitchFrameEachTime()
        {
            cycler = new Cycler(frameTime, 3, beginning);

            sprite.Expects.Exactly(2).Method(_ => _.DrawNextFrame());

            cycler.AddSprite(sprite.MockObject);
            cycler.Update(beginning + frameTime);
            cycler.Update(beginning + frameTime * 2);
        }
示例#2
0
        public void SwitchFrameEachTime()
        {
            cycler = new Cycler(frameTime, 3, beginning);

            sprite.Expects.Exactly(2).Method(_ => _.DrawNextFrame());

            cycler.AddSprite(sprite.MockObject);
            cycler.Update(beginning + frameTime);
            cycler.Update(beginning + frameTime * 2);
        }
示例#3
0
        public void DontSwitchFramesWhenFrameIntervalHasntPassed()
        {
            cycler = new Cycler(frameTime, 3, beginning);
            var inbetweenFrame = frameTime / 2.0f;

            sprite.Expects.One.Method(_ => _.DrawNextFrame());

            cycler.AddSprite(sprite.MockObject);
            cycler.Update(beginning + inbetweenFrame);
            cycler.Update(beginning + frameTime);
            cycler.Update(beginning + frameTime + inbetweenFrame);
        }
示例#4
0
        public void DontSwitchFramesWhenFrameIntervalHasntPassed()
        {
            cycler = new Cycler(frameTime, 3, beginning);
            var inbetweenFrame = frameTime / 2.0f;

            sprite.Expects.One.Method(_ => _.DrawNextFrame());

            cycler.AddSprite(sprite.MockObject);
            cycler.Update(beginning + inbetweenFrame);
            cycler.Update(beginning + frameTime);
            cycler.Update(beginning + frameTime + inbetweenFrame);
        }
示例#5
0
    public void Update()
    {
        if (heartRateCycler != null)
        {
            heartRateCycler.Update(Time.time);
        }

        setGuySplit();
    }
示例#6
0
        public void CyclerAnimatesIndefinitelyWhenTotalCyclesIsZero()
        {
            var totalCycles = 0;
            var attemptedCycles = 5;
            cycler = new Cycler(frameTime, totalCycles, beginning);

            sprite.Expects.Exactly(attemptedCycles).Method(_ => _.DrawNextFrame());

            cycler.AddSprite(sprite.MockObject);
            for (var cycle = 1; cycle < attemptedCycles; cycle++) {
                cycler.Update(beginning + frameTime * cycle);
            }
        }
示例#7
0
        public void CyclerStopsWhenTotalCyclesReached()
        {
            var totalCycles = 3;
            var attemptedCycles = 5;
            cycler = new Cycler(frameTime, totalCycles, beginning);

            sprite.Expects.Exactly(totalCycles).Method(_ => _.DrawNextFrame());

            cycler.AddSprite(sprite.MockObject);

            for (var cycle = 1; cycle < attemptedCycles; cycle++) {
                cycler.Update(beginning + frameTime * cycle);
            }
        }
示例#8
0
        public void CyclerAnimatesIndefinitelyWhenTotalCyclesIsZero()
        {
            var totalCycles     = 0;
            var attemptedCycles = 5;

            cycler = new Cycler(frameTime, totalCycles, beginning);

            sprite.Expects.Exactly(attemptedCycles).Method(_ => _.DrawNextFrame());

            cycler.AddSprite(sprite.MockObject);
            for (var cycle = 1; cycle < attemptedCycles; cycle++)
            {
                cycler.Update(beginning + frameTime * cycle);
            }
        }
示例#9
0
    void AnimateShapes(float time)
    {
        if (!triangleShowing() && circleCycler.Count() >= triangleWaitTime)
        {
            triangleCycler = new DelayedCycler(shapeSpeed, 6, 1f);
            triangle.visible(true);
            triangleCycler.AddSprite(triangle);
        }

        circleCycler.Update(time);

        if (triangleShowing())
        {
            triangleCycler.Update(time);
        }
    }
示例#10
0
        public void CyclerStopsWhenTotalCyclesReached()
        {
            var totalCycles     = 3;
            var attemptedCycles = 5;

            cycler = new Cycler(frameTime, totalCycles, beginning);

            sprite.Expects.Exactly(totalCycles).Method(_ => _.DrawNextFrame());

            cycler.AddSprite(sprite.MockObject);

            for (var cycle = 1; cycle < attemptedCycles; cycle++)
            {
                cycler.Update(beginning + frameTime * cycle);
            }
        }
示例#11
0
    public override void Update()
    {
        float now = Time.time;

        wiggler.Update(now);
        notSameCycler.Update(now);

        if (solved)
        {
            return;
        }

        if (shapes.touchedAtSameTime(now) && triangleShowing())
        {
            messagePromptCoordinator.clearTouch();
            messagePromptCoordinator.progress("stop shapes from changing");
            Handheld.Vibrate();
            wiggler.wiggleNow(now);
            endScene();
        }
        else
        {
            messagePromptCoordinator.hintWhenTouched(GameObject => {}, sensor, now,
                                                     new Dictionary <GameObject, ActionResponsePair[]> {
                { circle.gameObject, new [] { new ActionResponsePair("stop circle from changing", new[] { "Nope." }) } },
                { triangle.gameObject, new [] { new ActionResponsePair("stop triangle from changing", new[] { "Nope." }) } },
            });
        }

        AnimateShapes(now);

        // if touched circle, draw its bright first frame
        if (sensor.changeInsideSprite(Camera.main, circle))
        {
            circle.setFrame(0);
            circle.Animate();
        }

        // if touched triangle, ditto
        if (sensor.changeInsideSprite(Camera.main, triangle) && triangleShowing())
        {
            triangle.setFrame(0);
            triangle.Animate();
        }
    }
示例#12
0
    public override void Update()
    {
        var touch = new TouchSensor(input, gameObjectFinder);

        if (touch.insideSprite(Camera.main, buyMusic))
        {
            Application.OpenURL("http://itunes.apple.com/us/album/same-not-same-ep/id533347009");
        }
        else if (touch.insideSprite(Camera.main, news))
        {
            Application.OpenURL("http://themakingofthemakingof.com");
        }
        else if (touch.hasTaps())
        {
            endScene();
        }

        if (cycle_title.Complete())
        {
            animateStartButton();
        }

        cycle_title.Update(Time.time);
    }