示例#1
0
 public override void init(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     content = Content;
     backBar.init(Content);
     colorBar.init(Content);
     invencibleButton.init(Content);
     colorBar.origin = new Vector2(0, colorBar.position.Y + colorBar.texture.Height - 5);
     //ableInvencible = false;
     initDown         = false;
     colorBar.scale.Y = 0f;
 }
示例#2
0
        public override void update(GameTime gameTime)
        {
            acum++;
            if (acum > timerCount)
            {
                for (int i = 0; i <= quantity; i++)
                {
                    StaticObject temp = new StaticObject(particlePath);
                    temp.init(content);

                    temp.velocity       = new Vector2((float)(rnd.NextDouble() - 0.5d), (float)rnd.NextDouble());
                    temp.position       = position;
                    temp.timeToDestruct = 40;
                    vecParticles.AddLast(temp);
                }
                acum = 0;
            }
            for (int i = 0; i < vecParticles.Count; i++)
            {
                vecParticles.ElementAt(i).update(gameTime);
                if (vecParticles.ElementAt(i).dead)
                {
                    vecParticles.Remove(vecParticles.ElementAt(i));
                }
            }
            base.update(gameTime);
        }
示例#3
0
        public override void init(Microsoft.Xna.Framework.Content.ContentManager Content)
        {
            content = Content;
            image.init(Content);
            image.position.X = 800 / 2 - image.texture.Width / 2;
            image.position.Y = -image.texture.Height;

            tweener = new Tweener(image.position.Y, 40, 1f, Back.EaseOut);
            // tweener.endCallback = goBack;
        }
示例#4
0
 public override void init(Microsoft.Xna.Framework.Content.ContentManager Content)
 {
     content = Content;
     base.init(Content);
     image.init(Content);
     if (itemModel.rufusModel.title != "COMMING")
     {
         star.init(Content);
     }
 }
示例#5
0
        public override void init(ContentManager Content)
        {
            content = Content;
            base.init(Content);
            backShape.init(content);
            isActive   = false;
            position.X = 800 / 2 - texture.Width / 2;
            position.Y = -texture.Height;
            mainImage  = new StaticObject(GameModel.rufusModels.ElementAt(0).largePath);
            mainImage.init(content);
            star.init(content);


            firstSymbol.init(content);
            secSymbol.init(content);
            thrSymbol.init(content);

            backButton = new ArrowButton(hide);
            backButton.init(Content);



            ButtonModel defaultButtonModel = new ButtonModel(".\\Sprites\\GUI\\defaultButton\\shapeButton", ".\\Sprites\\GUI\\defaultButton\\shapeButtonXML", ButtonFactory.spriteFont);

            buyButton = new SimpleButton(defaultButtonModel, "BUY", new Point(186, 48), buyItem);
            buyButton.init(content);
            buyButton.fontScale  = .9f;
            buyButton.fontMargin = new Vector2(60, 2);

            cardImages.AddLast(mainImage);
            cardImages.AddLast(backButton);
            cardImages.AddLast(buyButton);
            cardImages.AddLast(firstSymbol);
            cardImages.AddLast(secSymbol);
            cardImages.AddLast(thrSymbol);
            cardImages.AddLast(star);


            isActive = false;
        }
示例#6
0
        public override void init(ContentManager Content)
        {
            content = Content;
            base.init(Content);
            backShape.init(content);
            isActive   = false;
            position.X = 800 / 2 - texture.Width / 2;
            position.Y = -texture.Height;
            mainImage  = new StaticObject(GameModel.rufusModels.ElementAt(0).largePath);
            mainImage.init(content);

            backButton = new ArrowButton(hide);
            backButton.init(Content);

            isActive = false;
        }
示例#7
0
        public override void init(ContentManager Content)
        {
            content = Content;
            base.init(Content);
            backShape.init(content);
            twButton.init(content);
            fbButton.init(content);
            isActive   = false;
            position.X = 800 / 2 - texture.Width / 2;
            position.Y = -texture.Height;
            mainImage  = new StaticObject(GameModel.rufusModels.ElementAt(0).largePath);
            mainImage.init(content);

            backButton = new ArrowButton(hide);
            backButton.init(Content);

            ButtonModel defaultButtonModel = new ButtonModel(".\\Sprites\\GUI\\defaultButton\\shapeButton", ".\\Sprites\\GUI\\defaultButton\\shapeButtonXML", ButtonFactory.spriteFont);



            isActive = false;
        }
        public override void init(ContentManager Content)
        {
            content = Content;
            base.init(Content);
            backShape.init(content);
            isActive   = false;
            position.X = 800 / 2 - texture.Width / 2;
            position.Y = -texture.Height;

            backButton = new ArrowButton(hide);
            backButton.init(Content);

            cheatButton = new ArrowButton(cheat);
            cheatButton.init(Content);
            cheatButton.position.X = 750;
            cheatButton.position.Y = 430;

            ButtonModel defaultButtonModel = new ButtonModel(".\\Sprites\\GUI\\defaultButton\\shapeButton", ".\\Sprites\\GUI\\defaultButton\\shapeButtonXML", ButtonFactory.spriteFont);

            cheatCounter = 0;

            isActive = false;
        }
示例#9
0
        public override void build()
        {
            base.build();

            outt = false;

            wearPage = new WearPage();
            addChild(wearPage);
            wearPage.init(content);


            itemPage = new ItemPage();
            addChild(itemPage);
            itemPage.init(content);

            levelPage = new LevelPage();
            addChild(levelPage);
            levelPage.init(content);

            pages = new LinkedList <DefaultPage>();
            pages.AddLast(wearPage);
            pages.AddLast(itemPage);
            pages.AddLast(levelPage);

            currentPage = wearPage;
            currentPage.show();

            ButtonModel defaultButtonModel = new ButtonModel(".\\Sprites\\GUI\\defaultButton\\shapeButton", ".\\Sprites\\GUI\\defaultButton\\shapeButtonXML", ButtonFactory.spriteFont);

            backButton = new HomeButton(gotoInit);
            backButton.init(content);
            backButton.position.Y = 20;
            backButton.position.X = -backButton.texture.Width - 5;
            backButton.tweener    = new Tweener(-backButton.texture.Width - 5, 20f, TimeSpan.FromSeconds(.5f), Back.EaseOut);
            backButton.tweener.Start();

            wearButton = new SimpleButton(defaultButtonModel, "WEAR", new Point(205, 56), setWearPage);
            wearButton.init(content);
            wearButton.fontScale = .9f;
            // wearButton.fontColor = new Color(63, 53, 127);
            wearButton.fontMargin = new Vector2(55, 6);
            wearButton.position.Y = 85;
            wearButton.position.X = -wearButton.texture.Width - 5;
            wearButton.tweener    = new Tweener(-wearButton.texture.Width - 5, 15f, TimeSpan.FromSeconds(.7f), Back.EaseOut);
            wearButton.tweener.Start();
            wearButton.isActive = true;

            // itemButton = new SimpleButton(new ButtonModel(".\\Sprites\\GUI\\defaultButton\\itemsButton", "", null), "", new Point(), setItemPage);
            itemButton = new SimpleButton(defaultButtonModel, "ITEM", new Point(205, 56), setItemPage);
            itemButton.init(content);
            itemButton.fontScale = .9f;
            //itemButton.fontColor = new Color(63,53,127);
            itemButton.fontMargin = new Vector2(62, 6);
            itemButton.position.Y = 150;
            itemButton.position.X = -itemButton.texture.Width - 5;
            itemButton.tweener    = new Tweener(-itemButton.texture.Width - 5, 15f, TimeSpan.FromSeconds(.8f), Back.EaseOut);
            itemButton.tweener.Start();

            levelButton = new SimpleButton(defaultButtonModel, "LEVELS", new Point(205, 56), setLevelPage);
            levelButton.init(content);
            levelButton.fontScale = .9f;
            //levelButton.fontColor = new Color(63, 53, 127);
            levelButton.fontMargin = new Vector2(50, 6);
            levelButton.position.Y = 215;
            levelButton.position.X = -levelButton.texture.Width - 5;
            levelButton.tweener    = new Tweener(-levelButton.texture.Width - 5, 15f, TimeSpan.FromSeconds(.9f), Back.EaseOut);
            levelButton.tweener.Start();

            coins = new StaticObject(".\\Sprites\\GUI\\shopScreen\\starContainer");
            coins.init(content);
            coins.position.Y = 405;
            coins.position.X = levelButton.position.X - 10;

            starsLabel = new IncrementalLabel(0, ButtonFactory.spriteFont);
            starsLabel.init(content);
            starsLabel.newValue(GameModel.currentPoints);
            starsLabel.position.Y = 415;
            starsLabel.position.X = coins.position.X + 60;

            addChild(wearButton);

            addChild(itemButton);
            addChild(levelButton);
            addChild(backButton);
            addChild(coins);
            addChild(starsLabel);
        }
示例#10
0
        public void show(RufusModel rufusModel, int _type)
        {
            type = _type;
            if (type == ItemBoxModel.WEARS_ID)
            {
                firstAtt = "BOUNCE";
                secAtt   = "GRAVITY";
                thrAtt   = "SPEED";

                if (rufusModel.behaviour.bounce == AbstractBehaviour.DEFAULT_BOUNCE)
                {
                    firstSymbol.reload(".\\Sprites\\GUI\\symbols\\equalSymbol");
                }
                else if (rufusModel.behaviour.bounce < AbstractBehaviour.DEFAULT_BOUNCE)
                {
                    firstSymbol.reload(".\\Sprites\\GUI\\symbols\\minusSymbol");
                }
                else
                {
                    firstSymbol.reload(".\\Sprites\\GUI\\symbols\\plusSymbol");
                }
                firstSymbol.init(content);

                if (rufusModel.behaviour.gravity == AbstractBehaviour.DEFAULT_GRAVITY)
                {
                    secSymbol.reload(".\\Sprites\\GUI\\symbols\\equalSymbol");
                }
                else if (rufusModel.behaviour.gravity < AbstractBehaviour.DEFAULT_GRAVITY)
                {
                    secSymbol.reload(".\\Sprites\\GUI\\symbols\\minusSymbol");
                }
                else
                {
                    secSymbol.reload(".\\Sprites\\GUI\\symbols\\plusSymbol");
                }
                secSymbol.init(content);

                if (rufusModel.behaviour.force == AbstractBehaviour.DEFAULT_SPEED)
                {
                    thrSymbol.reload(".\\Sprites\\GUI\\symbols\\equalSymbol");
                }
                else if (rufusModel.behaviour.force < AbstractBehaviour.DEFAULT_SPEED)
                {
                    thrSymbol.reload(".\\Sprites\\GUI\\symbols\\minusSymbol");
                }
                else
                {
                    thrSymbol.reload(".\\Sprites\\GUI\\symbols\\plusSymbol");
                }
                thrSymbol.init(content);
            }
            else if (type == ItemBoxModel.ITENS_ID)
            {
                firstAtt = "FREQUENCY";
                secAtt   = "POINTS";
                thrAtt   = "SPEED";

                if (rufusModel.behaviour.frequency == AbstractBehaviour.DEFAULT_FREQUENCY)
                {
                    firstSymbol.reload(".\\Sprites\\GUI\\symbols\\equalSymbol");
                }
                else if (rufusModel.behaviour.frequency < AbstractBehaviour.DEFAULT_FREQUENCY)
                {
                    firstSymbol.reload(".\\Sprites\\GUI\\symbols\\minusSymbol");
                }
                else
                {
                    firstSymbol.reload(".\\Sprites\\GUI\\symbols\\plusSymbol");
                }
                firstSymbol.init(content);

                if (rufusModel.behaviour.points == AbstractBehaviour.DEFAULT_POINTS)
                {
                    secSymbol.reload(".\\Sprites\\GUI\\symbols\\equalSymbol");
                }
                else if (rufusModel.behaviour.points < AbstractBehaviour.DEFAULT_POINTS)
                {
                    secSymbol.reload(".\\Sprites\\GUI\\symbols\\minusSymbol");
                }
                else
                {
                    secSymbol.reload(".\\Sprites\\GUI\\symbols\\plusSymbol");
                }
                secSymbol.init(content);

                if (rufusModel.behaviour.force == AbstractBehaviour.DEFAULT_SPEED)
                {
                    thrSymbol.reload(".\\Sprites\\GUI\\symbols\\equalSymbol");
                }
                else if (rufusModel.behaviour.force < AbstractBehaviour.DEFAULT_SPEED)
                {
                    thrSymbol.reload(".\\Sprites\\GUI\\symbols\\minusSymbol");
                }
                else
                {
                    thrSymbol.reload(".\\Sprites\\GUI\\symbols\\plusSymbol");
                }
                thrSymbol.init(content);
            }
            else if (type == ItemBoxModel.LEVELS_ID)
            {
                firstAtt = "GRAVITY";
                secAtt   = "POINTS";
                thrAtt   = "ENEMY FREQ.";

                if (rufusModel.behaviour.gravity == AbstractBehaviour.DEFAULT_GRAVITY)
                {
                    firstSymbol.reload(".\\Sprites\\GUI\\symbols\\equalSymbol");
                }
                else if (rufusModel.behaviour.gravity < AbstractBehaviour.DEFAULT_GRAVITY)
                {
                    firstSymbol.reload(".\\Sprites\\GUI\\symbols\\minusSymbol");
                }
                else
                {
                    firstSymbol.reload(".\\Sprites\\GUI\\symbols\\plusSymbol");
                }
                firstSymbol.init(content);

                if (rufusModel.behaviour.points == AbstractBehaviour.DEFAULT_POINTS)
                {
                    secSymbol.reload(".\\Sprites\\GUI\\symbols\\equalSymbol");
                }
                else if (rufusModel.behaviour.points < AbstractBehaviour.DEFAULT_POINTS)
                {
                    secSymbol.reload(".\\Sprites\\GUI\\symbols\\minusSymbol");
                }
                else
                {
                    secSymbol.reload(".\\Sprites\\GUI\\symbols\\plusSymbol");
                }
                secSymbol.init(content);

                if (rufusModel.behaviour.frequency == AbstractBehaviour.DEFAULT_FREQUENCY)
                {
                    thrSymbol.reload(".\\Sprites\\GUI\\symbols\\equalSymbol");
                }
                else if (rufusModel.behaviour.frequency < AbstractBehaviour.DEFAULT_FREQUENCY)
                {
                    thrSymbol.reload(".\\Sprites\\GUI\\symbols\\minusSymbol");
                }
                else
                {
                    thrSymbol.reload(".\\Sprites\\GUI\\symbols\\plusSymbol");
                }
                thrSymbol.init(content);
            }
            currentModel = rufusModel;
            titleLabel   = currentModel.title;
            descLabel    = currentModel.description;

            mainImage.reload(currentModel.largePath);
            mainImage.init(content);
            tweener = new Tweener(-texture.Height, 100f, 0.4f, Back.EaseOut);
            tweener.Start();
            tweener.endCallback = endShow;
        }
示例#11
0
        public override void build()
        {
            base.build();

            loadScreen.init(content);
            //SALVAR O CENARIO ATUAL
            RufusModel     temp  = GameModel.levelsModels.ElementAt(GameModel.currentLevelID);
            LevelBehaviour temp2 = (LevelBehaviour)(temp.behaviour);

            currentLevelModel = temp2.levelModel;

            background = new BackLevelView(currentLevelModel.bgPath);
            if (currentLevelModel.clouds != null)
            {
                background.addClouds(currentLevelModel.clouds);
            }
            background.setColor(currentLevelModel.color);

            background.init(content);
            addChild(background);
            background.start();
            outt = false;

            ButtonModel playModel = new ButtonModel(".\\Sprites\\GUI\\readyButton\\readyButton", ".\\Sprites\\GUI\\readyButton\\readyButtonXML", null);

            playButton = new SimpleButton(playModel, "", new Point(), gotoGame);
            playButton.init(content);
            playButton.position.Y = 570;
            playButton.position.X = 400 - playButton.texture.Width / 2;
            playButton.tweener    = new Tweener(playButton.position.Y, 350f, TimeSpan.FromSeconds(1.0f), Back.EaseOut);
            playButton.tweener.Start();

            locationButton = new SimpleButton(new ButtonModel(".\\Sprites\\GUI\\locationButton\\locationButton", ".\\Sprites\\GUI\\locationButton\\locationButtonXML", null), "", new Point(), changeLevelModel);
            locationButton.init(content);
            locationButton.position.Y = 480;
            locationButton.position.X = 400 - locationButton.texture.Width / 2;
            locationButton.tweener    = new Tweener(locationButton.position.Y, 260f, TimeSpan.FromSeconds(1.0f), Back.EaseOut);
            locationButton.tweener.Start();

            backButton = new HomeButton(gotoInit);
            backButton.init(content);
            backButton.position.Y = 40;
            backButton.position.X = 40;
            // backButton.tweener = new Tweener(backButton.position.Y, 40f, TimeSpan.FromSeconds(1.0f), Back.EaseOut);
            // backButton.tweener.Start();

            changeLevel = new ArrowButton(changeRufus);
            changeLevel.init(content);
            changeLevel.position.Y    = -40;
            changeLevel.position.X    = 490;
            changeLevel.spriteEffects = SpriteEffects.FlipHorizontally;
            changeLevel.scale         = new Vector2(.8f);
            changeLevel.tweener       = new Tweener(changeLevel.position.Y, 120f, TimeSpan.FromSeconds(1.0f), Cubic.EaseOut);
            changeLevel.tweener.Start();

            changeLevelBack = new ArrowButton(changeRufusBack);
            changeLevelBack.init(content);
            changeLevelBack.position.Y    = -40;
            changeLevelBack.position.X    = 268;
            changeLevelBack.spriteEffects = SpriteEffects.None;
            changeLevelBack.scale         = new Vector2(.8f);
            changeLevelBack.tweener       = new Tweener(changeLevel.position.Y, 120f, TimeSpan.FromSeconds(1.0f), Cubic.EaseOut);
            changeLevelBack.tweener.Start();

            backRufusBox = new SimpleButton(new ButtonModel(".\\Sprites\\GUI\\backChoiceRufus", "", null), "", new Point(), openCard);
            backRufusBox.init(content);
            backRufusBox.position.Y = -backRufusBox.texture.Height;
            backRufusBox.position.X = 400 - backRufusBox.texture.Width / 2;
            backRufusBox.tweener    = new Tweener(backRufusBox.position.Y, 40f, TimeSpan.FromSeconds(1.0f), Cubic.EaseOut);
            backRufusBox.tweener.Start();


            rufusImage = new StaticObject(GameModel.rufusModels.ElementAt(GameModel.currentRufusID).largePath);
            rufusImage.init(content);
            rufusImage.position.Y = backRufusBox.position.Y + rufusImage.texture.Height / 2 + backRufusBox.texture.Height / 2;
            rufusImage.position.X = 400 - rufusImage.texture.Width / 2;

            soundButton = new SoundButton(null);
            soundButton.init(content);
            soundButton.position.X = 700f;
            soundButton.position.Y = 40f;

            helpButton = new HelpButton(null);
            helpButton.init(content);
            helpButton.position.X = 600f;
            helpButton.position.Y = 40f;

            addChild(backRufusBox);
            addChild(playButton);
            addChild(changeLevel);
            addChild(changeLevelBack);
            addChild(locationButton);
            addChild(backButton);
            addChild(rufusImage);
            addChild(soundButton);
            addChild(helpButton);
        }
示例#12
0
 private void reloadRufus()
 {
     rufusImage.reload(GameModel.rufusModels.ElementAt(GameModel.currentRufusID).largePath);
     rufusImage.init(content);
 }
示例#13
0
        public override void build()
        {
            base.build();
            background = new StaticObject(".\\Sprites\\rufusConcept");
            background.init(content);
            addChild(background);

            outt = false;

            ButtonModel playModel = new ButtonModel(".\\Sprites\\GUI\\playButtonNew\\playButtonNew", ".\\Sprites\\GUI\\playButtonNew\\playButtonNewXML", null);


            soundButton = new SoundButton(null);
            soundButton.init(content);
            soundButton.position.X = 700f;
            soundButton.position.Y = 40f;

            infoButton = new InfoButton(Game1.showDevCard);
            infoButton.init(content);
            infoButton.position.X = 40f;
            infoButton.position.Y = 40f;

            playButton            = new SimpleButton(playModel, "", new Point(), gotoGame);
            playButton.fontMargin = new Vector2(55, 15);
            playButton.fontScale  = 1;
            playButton.init(content);
            playButton.position.Y = 480;
            playButton.position.X = 500;
            playButton.tweener    = new Tweener(playButton.position.Y, 350f, TimeSpan.FromSeconds(1.0f), Back.EaseOut);
            playButton.tweener.Start();

            ButtonModel shopModel = new ButtonModel(".\\Sprites\\GUI\\shopButton\\shopButton", ".\\Sprites\\GUI\\shopButton\\shopButtonXML", null);

            shopButton            = new SimpleButton(shopModel, "", new Point(), gotoShop);
            shopButton.fontMargin = new Vector2(55, 15);
            shopButton.fontScale  = 1;
            shopButton.init(content);
            shopButton.position.Y = 480;
            shopButton.position.X = 148;
            shopButton.tweener    = new Tweener(shopButton.position.Y, 350f, TimeSpan.FromSeconds(1.0f), Back.EaseOut);
            shopButton.tweener.Start();

            statisticsButton = new StatisticsButton(openStatistic);
            statisticsButton.init(content);
            statisticsButton.position.Y = 480;
            statisticsButton.position.X = 40;
            statisticsButton.tweener    = new Tweener(statisticsButton.position.Y, 350f, TimeSpan.FromSeconds(1.0f), Back.EaseOut);
            statisticsButton.tweener.Start();

            ButtonModel logoModel = new ButtonModel(".\\Sprites\\GUI\\rufusLogo", "", null);

            logoButton = new SimpleButton(logoModel, "", new Point(), null);
            logoButton.init(content);
            logoButton.position.Y = -100;
            logoButton.position.X = 140;
            logoButton.tweener    = new Tweener(logoButton.position.Y, 20f, TimeSpan.FromSeconds(1.0f), Back.EaseOut);
            logoButton.tweener.Start();

            starsLabel = new IncrementalLabel(0, ButtonFactory.spriteFont);
            starsLabel.init(content);
            starsLabel.newValue(GameModel.currentPoints);
            starsLabel.position.Y = shopButton.position.Y + 25;
            starsLabel.position.X = shopButton.position.X + 72;
            starsLabel.fontSize   = 0.8f;

            addChild(playButton);
            addChild(shopButton);
            addChild(statisticsButton);
            addChild(logoButton);
            addChild(starsLabel);
            addChild(soundButton);
            addChild(infoButton);
        }