Example #1
0
 private void CreateLayer()
 {
     mLayer = Renderer.AddLayer();
     mLayer.LayerCameraSettings = new LayerCameraSettings();
     mLayer.LayerCameraSettings.IsInScreenSpace = true;
     mLayer.Name = "Ruler Layer";
 }
 public override void InitLayoutView()
 {
     State     = new BoardCardSelectionAreaLayoutState(Layout);
     Positions = new BoardCardSelectionAreaLayoutStatePositions(Layout);
     MainLayer = Renderer.CreateLayer(Layout);
     Renderer.AddLayer(MainLayer);
     Init();
 }
Example #3
0
 public override void InitLayoutView()
 {
     CharacterAnimations = new Dictionary <int, AnimatedCharacterSubLayout>();
     for (int i = 1; i <= 6; i++)
     {
         CharacterAnimations.Add(i, new AnimatedCharacterSubLayout(Client, i));
     }
     MainLayer = Renderer.CreateLayer(Layout);
     Renderer.AddLayer(MainLayer);
     Init();
 }
Example #4
0
        public void Init()
        {
            mainLayer = Renderer.CreateLayer(Layout);
            Renderer.AddLayer(mainLayer);
            State.SelectedNumberOfPlayers = 1;


            for (int j = 0; j < 6; j++)
            {
                TouchManager.PushClickRect(new TouchRect(State.Positions.NumberOfPlayersPositions[j].X, State.Positions.NumberOfPlayersPositions[j].Y, State.Positions.ButtonSize.X, State.Positions.ButtonSize.Y, numberOfPlayersClick, state: j + 1, pointIsCenter: true));
            }

            TouchManager.PushClickRect(new TouchRect(State.Positions.BackPosition.X, State.Positions.BackPosition.Y, 102, 113, backClick));

            //            TouchManager.PushClickRect(new TouchRect(State.Positions.ModesButtonPosition.X - 692, State.Positions.ModesButtonPosition.Y - 107, 1384, 215, changeModeClick));
            TouchManager.PushClickRect(new TouchRect(State.Positions.StartGamePosition.X, State.Positions.StartGamePosition.Y, Layout.Width, 257, startGameClick));

            State.StartClicked       = false;
            State.StartGameAnimation = MotionManager.StartMotion(0, -400)
                                       .Motion(new WaitMotion(500))
                                       .Motion(new AnimationMotion(0, 0, 500, AnimationEasing.CubicEaseIn))
                                       .Motion(new WaitMotion(500))
                                       .OnRender((layer, posX, posY, animationIndex, percentDone) => { drawStartGame(posY); })
                                       .OnComplete(() =>
            {
                if (State.StartClicked)
                {
                    if (!HasMultiplayer)
                    {
                        State.SelectedNumberOfPlayers = 1;
                    }

                    State.ScreenManager.StartGame(State.SelectedNumberOfPlayers, State.SelectedMode);
                }
            });

            State.MenuAnimation = MotionManager.StartMotion(-1500, 0)
                                  .Motion(new AnimationMotion(0, 0, 800, AnimationEasing.CubicEaseIn))
                                  .OnRender((layer, posX, posY, animationIndex, percentDone) => { drawMenu(posX); });

            GameService.CloudSubLayout.InitLayoutView(TouchManager);
        }
        public override void Init()
        {
            CreateObjects();
            base.Init();

            this.BackgroundPlane.Init();
            this.OverlaysPlane.Init();
            this.GameModel.Client().TouchManager.Init();

            Renderer.AddLayer(BackgroundPlane.Plane);
            Renderer.AddLayer(ChutesPlane.Client().BackPlane);
            Renderer.AddLayer(CannonBallPlane.Client().Plane);
            Renderer.AddLayer(CannonPlane.Client().Plane);
            Renderer.AddLayer(ChutesPlane.Client().FrontPlane);
            Renderer.AddLayer(PegsPlane.Client().Plane);
            Renderer.AddLayer(OverlaysPlane.Plane);

            if (PegPhysicsManager.Client().ShouldDraw)
            {
                //            Renderer.AddLayer(PegPhysicsManager.Plane);
            }
        }
Example #6
0
        public void Init()
        {
            mainLayer = Renderer.CreateLayer(_width, _height, Layout);
            Renderer.AddLayer(mainLayer);

            TouchManager = new TouchManager(this._game.Client);



            this.LobbyOverlay      = Renderer.GetImage("lobby.lobby");
            this.ProfileOverlay    = Renderer.GetImage("lobby.profile");
            this.GoldCoinOverlay   = Renderer.GetImage("coinBoxOverlay");
            this.SilverCoinOverlay = Renderer.GetImage("silverCoinBoxOverlay");
            this.LobbyBackground   = Renderer.GetImage("lobby.wideBackground");

            this.AllRoomsOverlay  = Renderer.GetImage("lobby.allRooms");
            this.FeaturedOverlay  = Renderer.GetImage("lobby.featuredText");
            this.FavoritesOverlay = Renderer.GetImage("lobby.favoritesText");

            this.EyeOverlay    = Renderer.GetImage("lobby.eyeBall");
            this.DollarOverlay = Renderer.GetImage("lobby.dollarSign");
            this.StarOverlay   = Renderer.GetImage("lobby.favoritesStar");

            this.SelectedOverlay = Renderer.GetImage("lobby.selectedButton");

            this.CreateRoomTextOverlay = Renderer.GetImage("lobby.createNewRoomText");
            this.OrangeButtonOverlay   = Renderer.GetImage("lobby.orangeButton");
            this.PlusOverlay           = Renderer.GetImage("lobby.plus");

            this.ScrollBarOverlay       = Renderer.GetImage("lobby.scrollBar");
            this.ScrollBarButtonOverlay = Renderer.GetImage("lobby.scrollButton");



            this.LobbyOverlayPosition      = new Point(45, 14);
            this.ProfileOverlayPosition    = new Point(192, 9);
            this.GoldCoinOverlayPosition   = new Point(349, 3);
            this.SilverCoinOverlayPosition = new Point(610, 3);
            this.LobbyBackgroundPosition   = new Point(11, 45);


            this.AllRoomsButtonPosition  = new Point(30, 55);
            this.FeaturedButtonPosition  = new Point(205, 55);
            this.FavoritesButtonPosition = new Point(380, 55);

            this.ButtonIconOffset = new Point(25, 25);
            this.ButtonTextOffset = new Point(100, 25);

            this.CreateRoomPosition = new Point(565, 55);

            this.CreateRoomIconOffset = new Point(25, 25);
            this.CreateRoomTextOffset = new Point(100, 25);

            this.RoomsPosition = new Point(12, 110);

            RoomButtonColor          = new Color(230, 230, 230);
            AlternateRoomButtonColor = new Color(191, 191, 191);

            ScrollBarPosition = new Point((int)(LobbyOverlayPosition.X + LobbyBackground.Width - ScrollBarButtonOverlay.Center.X - 50), RoomsPosition.Y);

            RoomButtonSize = new Size(745, 90);

            NumberOfRoomsVisible = 5;
            createTouches();

            Layout.UIManager.CreateTextBox(new Rectangle(CreateRoomPosition, OrangeButtonOverlay.Width, OrangeButtonOverlay.Height), this);

            Rooms = new List <LobbyRoom>()
            {
                new LobbyRoom()
                {
                    Name = "Room Name 1"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 2"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 3"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 4"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 5"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 6"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 7"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 8"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 9"
                },
                new LobbyRoom()
                {
                    Name = "Room Name 10"
                },
            };
        }
Example #7
0
        public void Init()
        {
            State = new LandingAreaLayoutState();
            State.SoundSubLayout = new SoundSubLayout(Client);

            setNextHop();
            GameService.CloudSubLayout.InitLayoutView(TouchManager);
            GameService.CloudSubLayout.SlideLeft();
            mainLayer = Renderer.CreateLayer(Layout.Width, Layout.Height, Layout);
            Renderer.AddLayer(mainLayer);


            TouchManager.PushClickRect(new TouchRect(Positions.StartLocation.X, Positions.StartLocation.Y, 1300, 324, startGame, true));
            TouchManager.PushClickRect(new TouchRect(Positions.TutorialButtonPosition.X, Positions.TutorialButtonPosition.Y, 200, 200, tutorialTrigger, true));

            TouchManager.PushClickRect(new TouchRect(Positions.AboutBubblePosition + Positions.AboutContactUsPosition, Positions.AboutButtonSize, aboutContactTouch));
            TouchManager.PushClickRect(new TouchRect(Positions.AboutBubblePosition + Positions.AboutRatePosition, Positions.AboutButtonSize, aboutRateTouch));

            TouchManager.PushClickRect(new TouchRect(Positions.AboutOpenPenguinPosition, 533, 512, toggleOpening, true));


            TouchManager.PushClickRect(new TouchRect(0, 0, 1536, 2048, closeBox));

            IImage logoImage    = Assets.Images.Layouts.PenguinLogo;
            IImage shuffleImage = Assets.Images.Layouts.ShuffleLogo;

            PenguinLogoAnimation = MotionManager.StartMotion(-1000, Positions.PenguinLogoLocation.Y)
                                   .Motion(new WaitMotion(300))
                                   .Motion(new AnimationMotion(Positions.PenguinLogoLocation.X, Positions.PenguinLogoLocation.Y, 500, AnimationEasing.SineEaseIn))
                                   .OnRender((layer, posX, posY, animationIndex, percentDone) => mainLayer.DrawImage(logoImage, posX, posY, true))
                                   .OnComplete(() => { });

            ShuffleLogoAnimation = MotionManager.StartMotion(-1000, Positions.ShuffleLogoLocation.Y)
                                   .Motion(new WaitMotion(300))
                                   .Motion(new AnimationMotion(Positions.ShuffleLogoLocation.X, Positions.ShuffleLogoLocation.Y, 600, AnimationEasing.SineEaseIn))
                                   .OnRender((layer, posX, posY, animationIndex, percentDone) => mainLayer.DrawImage(shuffleImage, posX, posY, true))
                                   .OnComplete(() => { });

            PlayButtonAnimation = MotionManager.StartMotion(-1000, Positions.StartLocation.Y)
                                  .Motion(new WaitMotion(300))
                                  .Motion(new AnimationMotion(Positions.StartLocation, 700, AnimationEasing.SineEaseIn))
                                  .OnRender((layer, posX, posY, animationIndex, percentDone) => mainLayer.DrawImage(Assets.Images.Layouts.PlayButton, posX, posY, true))
                                  .OnComplete(() => { });


            State.AboutState = AboutState.Closed;


            IImage penguinImage = Assets.Images.About.MainPenguin;

            AboutOpenDialogAnimation = MotionManager.StartMotion(0, 0)
                                       .Motion(new AnimationMotion(0, 100, 600, AnimationEasing.Linear))
                                       .OnRender((layer, posX, posY, animationIndex, percentDone) =>
            {
                layer.Save();
                layer.SetDrawingTransparency(posY / 100f);
                aboutBoxRender(layer);
                layer.Restore();
            });

            RandomPenguinHop = MotionManager.StartMotion(Positions.AboutPenguinPosition)
                               .Motion(new AnimationMotion(Positions.AboutPenguinPosition.X, Positions.AboutPenguinPosition.Y - 25, 200, AnimationEasing.CubicEaseOut))
                               .Motion(new AnimationMotion(Positions.AboutPenguinPosition, 150, AnimationEasing.CubicEaseIn))
                               .Motion(new AnimationMotion(Positions.AboutPenguinPosition.X, Positions.AboutPenguinPosition.Y - 50, 200, AnimationEasing.CubicEaseOut))
                               .Motion(new AnimationMotion(Positions.AboutPenguinPosition, 150, AnimationEasing.CubicEaseIn))
                               .OnRender((layer, posX, posY, animationIndex, percentDone) => { mainLayer.DrawImage(penguinImage, posX, posY, true); })
                               .DontStart();


            InitialPenguinHop = MotionManager.StartMotion(Positions.AboutPenguinPosition.X, Positions.AboutPenguinPosition.Y + 1000)
                                .Motion(new WaitMotion(300))
                                .Motion(new AnimationMotion(Positions.AboutPenguinPosition.X, Positions.AboutPenguinPosition.Y - 25, 1000, AnimationEasing.CubicEaseOut))
                                .Motion(new AnimationMotion(Positions.AboutPenguinPosition, 150, AnimationEasing.CubicEaseIn))
                                .Motion(new AnimationMotion(Positions.AboutPenguinPosition.X, Positions.AboutPenguinPosition.Y - 50, 200, AnimationEasing.CubicEaseOut))
                                .Motion(new AnimationMotion(Positions.AboutPenguinPosition, 150, AnimationEasing.CubicEaseIn))
                                .OnRender((layer, posX, posY, animationIndex, percentDone) => { mainLayer.DrawImage(penguinImage, posX, posY, true); });

            AboutCloseDialogAnimation = MotionManager.StartMotion(0, 100)
                                        .Motion(new AnimationMotion(0, 0, 600, AnimationEasing.Linear))
                                        .OnRender((layer, posX, posY, animationIndex, percentDone) =>
            {
                layer.Save();
                layer.SetDrawingTransparency(posY / 100f);
                aboutBoxRender(layer);
                layer.Restore();
            });

            AboutOpenAnimation = MotionManager.StartMotion(Positions.AboutPenguinPosition,
                                                           new AnimationMotion(Positions.AboutOpenPenguinPosition, 600, AnimationEasing.BounceEaseOut))
                                 .OnRender((layer, posX, posY, animationIndex, percentDone) => { mainLayer.DrawImage(penguinImage, posX, posY, true); }).OnComplete(() =>
            {
                setNextHop();
                State.AboutState = AboutState.Opened;
            });

            AboutCloseAnimation = MotionManager.StartMotion(Positions.AboutOpenPenguinPosition,
                                                            new AnimationMotion(Positions.AboutPenguinPosition, 400, AnimationEasing.CubicEaseIn))
                                  .OnRender((layer, posX, posY, animationIndex, percentDone) => { mainLayer.DrawImage(penguinImage, posX, posY, true); }).OnComplete(() =>
            {
                setNextHop();
                State.AboutState = AboutState.Closed;
            });

            StartGameAnimation = MotionManager.StartMotion(Positions.AboutPenguinPosition).
                                 Motion(new AnimationMotion(Positions.AboutPenguinPosition.X, 1300, 400, AnimationEasing.QuadEaseOut)).
                                 Motion(new AnimationMotion(Positions.AboutPenguinPosition.X, Positions.AboutPenguinPosition.Y + 100, 350, AnimationEasing.QuadEaseIn)).
                                 Motion(new AnimationMotion(Positions.AboutPenguinPosition.X, 700, 400, AnimationEasing.QuadEaseOut)).
                                 Motion(new AnimationMotion(Positions.AboutPenguinPosition.X, Positions.AboutPenguinPosition.Y + 200, 350, AnimationEasing.QuadEaseIn)).
                                 Motion(new AnimationMotion(Positions.AboutPenguinPosition.X, -500, 500, AnimationEasing.QuadEaseOut))
                                 .OnRender((layer, posX, posY, animationIndex, percentDone) => { mainLayer.DrawImage(penguinImage, posX, posY, true); }).OnComplete(() =>
            {
                GameService.CloudSubLayout.SlideRight();
                _screenTransitioner.ChangeToSettingsScreen();
            });


            State.SoundSubLayout.InitLayoutView(TouchManager);
        }