예제 #1
0
        public GetBallOverlay() : base()
        {
            giftBox = new AnimatedGameObject(Depth.GiftBox);
            giftBox.LoadAnimation("Sprites/Animations/spr_animation_getball@4x3", "box", false, 0.05f);
            giftBox.PlayAnimation("box", true);
            giftBox.SetOriginToCenter();
            giftBox.LocalPosition = new Vector2(320, 600);
            AddChild(giftBox);

            glowing = new AnimatedGameObject(Depth.OverlayButton2);
            glowing.LoadAnimation("Sprites/Animations/spr_animation_glowing@5x2", "glowing", true, 0.1f);
            glowing.PlayAnimation("glowing", true);
            glowing.SetOriginToCenter();
            glowing.LocalPosition = new Vector2(350, 500);
            AddChild(glowing);

            background = new SpriteGameObject("Sprites/Backgrounds/spr_getball", Depth.OverlayBackground2);
            AddChild(background);

            message = new TextGameObject("Fonts/GetBall", Depth.OverlayMessage, Color.White, TextGameObject.HorizontalAlignment.Center, TextGameObject.VerticalAlignment.Center);
            AddChild(message);
            message.Visible       = false;
            message.Text          = "Click to get ball";
            message.LocalPosition = new Vector2(350, 900);

            fireWorkMaker = new ListStar(Depth.RandomBall + 0.001f);
            AddChild(fireWorkMaker);
            Reset();
        }
예제 #2
0
        public PlayState()
        {
            for (int i = 0; i < Constant.NumberBrickRate.Length; i++)
            {
                NumberBricks.AddRange(Enumerable.Repeat <int>(i, Constant.NumberBrickRate[i]));
            }

            gameObjects.AddChild(new SpriteGameObject("Sprites/Backgrounds/spr_play", Depth.Backgroud));
            gameObjects.AddChild(ListBrick.Instance);
            gameObjects.AddChild(ListBall.Instance);
            gameObjects.AddChild(Director.Instance);
            gameObjects.AddChild(ListItemAddBall.Instance);
            gameObjects.AddChild(ListItemAddCoin.Instance);
            gameObjects.AddChild(ListItemClearColumn.Instance);
            gameObjects.AddChild(ListItemClearRow.Instance);
            gameObjects.AddChild(ListItemSpreadBall.Instance);

            pauseButton = new Button("Sprites/Buttons/spr_pause", Depth.Button);
            gameObjects.AddChild(pauseButton);
            pauseButton.SetOriginToLeftCenter();
            pauseButton.LocalPosition = new Vector2(20, 75);

            guideButton = new Button("Sprites/Buttons/spr_guide", Depth.Button);
            gameObjects.AddChild(guideButton);
            guideButton.SetOriginToLeftCenter();
            guideButton.LocalPosition = new Vector2(130, 75);



            playHighScore = new TextGameObject("Fonts/PlayHighScore", Depth.Button, Color.White, TextGameObject.HorizontalAlignment.Right, TextGameObject.VerticalAlignment.Top);
            gameObjects.AddChild(playHighScore);
            playHighScore.LocalPosition = new Vector2(680, 30);

            playMoney = new TextGameObject("Fonts/PlayMoney", Depth.Button, Color.White, TextGameObject.HorizontalAlignment.Left, TextGameObject.VerticalAlignment.Center);
            gameObjects.AddChild(playMoney);
            playMoney.LocalPosition = new Vector2(120, 1132);

            playScore = new TextGameObject("Fonts/PlayScore", Depth.Button, Color.White, TextGameObject.HorizontalAlignment.Center, TextGameObject.VerticalAlignment.Top);
            gameObjects.AddChild(playScore);
            playScore.LocalPosition = new Vector2(350, 20);

            pauseOverlay = new PauseOverlay();
            gameObjects.AddChild(pauseOverlay);

            continueOverlay = new ContinueOverlay(this);
            gameObjects.AddChild(continueOverlay);

            endGameOverlay = new EndGameOverlay();
            gameObjects.AddChild(endGameOverlay);


            fireWorkMaker = new ListStar(Depth.BallNumber + 0.001f);
            gameObjects.AddChild(fireWorkMaker);
            Reset();
        }