Exemplo n.º 1
0
    private void HandleGotThingy(Thingy thingy)
    {
        if (thingy.isGood)
        {
            FSoundManager.PlaySound("get");
            hudLayer.score += 1;
            maxThingies    += 5;
            goodThingiesCount--;
        }
        else
        {
            gameOver = true;
            FSoundManager.PlaySound("lose");

            FLabel score = new FLabel("BlairMdITC", hudLayer.score.ToString());
            score.x     = Futile.screen.halfWidth;
            score.y     = Futile.screen.halfHeight + 75;
            score.scale = 0f;
            score.color = Color.black;
            Go.to(score, 0.5f, new TweenConfig().addTweenProperty(new FloatTweenProperty("scale", 1.0f, false)).setEaseType(EaseType.BackInOut));

            AddChild(score);

            again = new FButton("button.png", "buttonOver.png", "spawn");
            again.SignalRelease += HandleAgainSignalRelease;
            again.AddLabel("BlairMdITC", "Play Again", Color.black);
            again.label.scale = 0.3f;
            again.scale       = 0f;
            again.x           = Futile.screen.halfWidth;
            again.y           = Futile.screen.halfHeight;
            Go.to(again, 0.5f, new TweenConfig().addTweenProperty(new FloatTweenProperty("scale", 1.0f, false)).setEaseType(EaseType.BackInOut));

            AddChild(again);
        }

        thingies.Remove(thingy);
        thingy.Destroy();
    }
Exemplo n.º 2
0
    private void HandleGotThingy(Thingy thingy)
    {
        if (thingy.isGood) {
            FSoundManager.PlaySound("get");
            hudLayer.score += 1;
            maxThingies += 5;
            goodThingiesCount--;
        }
        else {
            gameOver = true;
            FSoundManager.PlaySound("lose");

            FLabel score = new FLabel("BlairMdITC", hudLayer.score.ToString());
            score.x = Futile.screen.halfWidth;
            score.y = Futile.screen.halfHeight + 75;
            score.scale = 0f;
            score.color = Color.black;
            Go.to(score, 0.5f, new TweenConfig().addTweenProperty(new FloatTweenProperty("scale", 1.0f, false)).setEaseType(EaseType.BackInOut));

            AddChild(score);

            again = new FButton("button.png", "buttonOver.png", "spawn");
            again.SignalRelease += HandleAgainSignalRelease;
            again.AddLabel("BlairMdITC", "Play Again", Color.black);
            again.label.scale = 0.3f;
            again.scale = 0f;
            again.x = Futile.screen.halfWidth;
            again.y = Futile.screen.halfHeight;
            Go.to(again, 0.5f, new TweenConfig().addTweenProperty(new FloatTweenProperty("scale", 1.0f, false)).setEaseType(EaseType.BackInOut));

            AddChild(again);
        }

        thingies.Remove(thingy);
        thingy.Destroy();
    }