Esempio n. 1
0
        private void checkarray(int w)
        {
            string Font = "Coalition", SubFont = "MarkerFelt";
            int    FontSize = 36, SubFontSize = 22;

            deletelabels();
            labels.Clear();
            plaatjes.Clear();

            switch (PageCounter)
            {
            case 1:
                CCLabel Welcome = new CCLabel("Welkom bij Spacesonne", Font, FontSize, CCLabelFormat.SpriteFont);
                Welcome.Position = new CCPoint(bounds.Center.X, 700);
                labels.Add(Welcome);
                for (int i = 0; i < uitlegdeel1.Length; i++)
                {
                    CCLabel cclabel = new CCLabel(uitlegdeel1[i], SubFont, SubFontSize, CCLabelFormat.SpriteFont);
                    cclabel.Position = new CCPoint(bounds.Center.X, (600 - (i * 60)));
                    labels.Add(cclabel);
                }
                break;

            case 2:
                CCLabel components = new CCLabel("Components", Font, FontSize, CCLabelFormat.SpriteFont);
                components.Position = new CCPoint(bounds.Center.X, 700);
                //CCSprite Sateliette =  TexturePool.GetSprite("10003");
                // Sateliette.Position = new CCPoint();
                labels.Add(components);
                for (int i = 0; i < uitlegdeel2.Length; i++)
                {
                    CCLabel cclabel = new CCLabel(uitlegdeel2[i], SubFont, SubFontSize, CCLabelFormat.SpriteFont);
                    cclabel.Position = new CCPoint(bounds.MidX, (600 - (i * 100)));
                    labels.Add(cclabel);
                }
                break;

            case 3:
                CCLabel Goaltitle = new CCLabel("The goal of the game", Font, FontSize, CCLabelFormat.SpriteFont);
                Goaltitle.Position = new CCPoint(bounds.Center.X, 700);
                labels.Add(Goaltitle);
                for (int i = 0; i < uitlegdeel3.Length; i++)
                {
                    CCLabel cclabel = new CCLabel(uitlegdeel3[i], SubFont, SubFontSize, CCLabelFormat.SpriteFont);
                    cclabel.Position = new CCPoint((bounds.MidX), (600 - (i * 33)));
                    labels.Add(cclabel);
                }
                break;

            case 4:
                CCLabel whatturn = new CCLabel("What can I do on my turn", Font, FontSize, CCLabelFormat.SpriteFont);
                whatturn.Position = new CCPoint(bounds.Center.X, 700);
                labels.Add(whatturn);
                for (int i = 0; i < uitlegdeel4.Length; i++)
                {
                    CCLabel cclabel = new CCLabel(uitlegdeel4[i], SubFont, SubFontSize, CCLabelFormat.SpriteFont);
                    cclabel.Position = new CCPoint(600, (550 - (i * 100)));
                    labels.Add(cclabel);
                }
                break;

            case 5:
                CCLabel FinishedRoad = new CCLabel("How to finish a road?", Font, FontSize, CCLabelFormat.SpriteFont);
                FinishedRoad.Position = new CCPoint(bounds.Center.X, 700);
                labels.Add(FinishedRoad);
                CCSprite Road1 = TexturePool.GetSprite("21111");
                Road1.Rotation = -90; Road1.Position = new CCPoint(850, 400); plaatjes.Add(Road1);
                CCSprite Road2 = TexturePool.GetSprite("20202");
                Road2.Rotation = 90; Road2.Position = new CCPoint(950, 400);  plaatjes.Add(Road2);
                CCSprite Road3 = TexturePool.GetSprite("02220");
                Road3.Position = new CCPoint(1050, 400); plaatjes.Add(Road3);

                for (int i = 0; i < uitlegdeel5.Length; i++)
                {
                    CCLabel cclabel = new CCLabel(uitlegdeel5[i], SubFont, SubFontSize, CCLabelFormat.SpriteFont);
                    cclabel.Position = new CCPoint((bounds.MidX), (600 - (i * 350)));
                    labels.Add(cclabel);
                }
                break;

            case 6:
                CCLabel FinishedSpacestation = new CCLabel("How to finish a spacestation?", Font, FontSize, CCLabelFormat.SpriteFont);
                FinishedSpacestation.Position = new CCPoint(bounds.Center.X, 700);
                labels.Add(FinishedSpacestation);
                CCSprite SpaceStation1 = TexturePool.GetSprite("21202");
                SpaceStation1.Rotation = 180; SpaceStation1.Position = new CCPoint(850, 350); plaatjes.Add(SpaceStation1);
                CCSprite SpaceStation2 = TexturePool.GetSprite("10101");
                SpaceStation2.Rotation = 90; SpaceStation2.Position = new CCPoint(950, 350); plaatjes.Add(SpaceStation2);
                CCSprite SpaceStation3 = TexturePool.GetSprite("01000");
                SpaceStation3.Position = new CCPoint(1050, 350); plaatjes.Add(SpaceStation3);
                for (int i = 0; i < uitlegdeel6.Length; i++)
                {
                    CCLabel cclabel = new CCLabel(uitlegdeel6[i], SubFont, SubFontSize, CCLabelFormat.SpriteFont);
                    cclabel.Position = new CCPoint((bounds.MidX), (600 - (i * 33)));
                    labels.Add(cclabel);
                }
                break;

            case 7:
                CCLabel FinishedSatalite = new CCLabel("How to finish a satelite?", Font, FontSize, CCLabelFormat.SpriteFont);
                FinishedSatalite.Position = new CCPoint(bounds.Center.X, 700);
                CCSprite Finished = new CCSprite("Finished sateliette");
                Finished.Position = new CCPoint(900, 300);
                plaatjes.Add(Finished);
                labels.Add(FinishedSatalite);
                for (int i = 0; i < uitlegdeel7.Length; i++)
                {
                    CCLabel cclabel = new CCLabel(uitlegdeel7[i], SubFont, SubFontSize, CCLabelFormat.SpriteFont);
                    cclabel.Position = new CCPoint((bounds.MidX), (600 - (i * 33)));
                    labels.Add(cclabel);
                }
                break;

            case 8:
                CCLabel FinishedGame = new CCLabel("When is the game finished?", Font, FontSize, CCLabelFormat.SpriteFont);
                FinishedGame.Position = new CCPoint(bounds.Center.X, 700);
                labels.Add(FinishedGame);
                for (int i = 0; i < uitlegdeel8.Length; i++)
                {
                    CCLabel cclabel = new CCLabel(uitlegdeel8[i], SubFont, SubFontSize, CCLabelFormat.SpriteFont);
                    cclabel.Position = new CCPoint((bounds.MidX), (600 - (i * 33)));
                    labels.Add(cclabel);
                }

                CCLabel EndofHalp = new CCLabel("You are ready to play the game now.\nGood luck but most of all have fun!", Font, FontSize, CCLabelFormat.SpriteFont);
                EndofHalp.Position = new CCPoint(bounds.Center.X, 300);
                labels.Add(EndofHalp);
                break;

            default:
                MainActivity.SwitchToMenu(SceneIds.OpeningMenu, 0);
                break;
            }
            paintlabels();
        }
Esempio n. 2
0
        void OnTouchesMoved(List <CCTouch> touches, CCEvent touchEvent)
        {
            if (touches.Count <= 0)
            {
                return;
            }

            float x = touches[0].LocationOnScreen.X;
            float y = touches[0].LocationOnScreen.Y;

            if (m_IsCardDragging)
            {
                CCSprite Spr = TexturePool.GetSprite(m_Game.m_CurrentCard.m_Hash);
                Spr.Position = touches[0].LocationOnScreen;

                foreach (CCTouch i in touches)
                {
                    CCPoint p = i.LocationOnScreen;
                    p = m_Overlay.ScreenToWorldspace(p);
                    m_Overlay.m_CardButton.Position = p;
                }
            }
            else
            {
                if (m_Touches == 1) // Pan
                {
                    foreach (CCTouch i in touches)
                    {
                        var s = m_BoardLayer.Camera.CenterInWorldspace;
                        s.X += i.PreviousLocationOnScreen.X - i.LocationOnScreen.X;
                        s.Y += i.LocationOnScreen.Y - i.PreviousLocationOnScreen.Y;
                        m_BoardLayer.Camera.CenterInWorldspace = s;

                        var target = m_BoardLayer.Camera.TargetInWorldspace;
                        target.X = s.X;
                        target.Y = s.Y;
                        m_BoardLayer.Camera.TargetInWorldspace = target;
                    }
                }
                else if (m_Touches == 2) // Zoom
                {
                    if (touches.Count < 2)
                    {
                        return;
                    }

                    for (int i = 0; i < touches.Count; i += 2)
                    {
                        CCPoint fir   = touches[i].LocationOnScreen;
                        CCPoint sec   = touches[i + 1].LocationOnScreen;
                        CCPoint third = touches[i].PreviousLocationOnScreen;
                        CCPoint four  = touches[i + 1].PreviousLocationOnScreen;

                        float one = CCPoint.Distance(fir, sec);
                        float two = CCPoint.Distance(third, four);

                        if (one < two)
                        {
                            m_BoardLayer.UpdateScale(-0.05f);
                        }
                        else
                        {
                            m_BoardLayer.UpdateScale(0.05f);
                        }
                    }
                }
            }
        }