Пример #1
0
        public override void Resume()
        {
            GResource.LoadTextures();

            var imageFon = new GImage(Game);

            imageFon.SetTexture(GResource.game_fon);
            imageFon.SetWidth(Game.GetWindowWidth());
            imageFon.SetHeight(Game.GetWindowHeight());
            imageFon.SetX(Game.GetWindowWidth() / 2);
            imageFon.SetY(Game.GetWindowHeight() / 2);
            AddElement(imageFon);

            tree = new ChristmasTree(Game);
            tree.GenerateDecorations(3);

            train = new Train(Game, GResource.train);
            train.Initialize(Game.GetWindowWidth() / 2, 65, 90, 30);
            train.SetChristmasTree(tree);

            cat = new Cat(Game, Game.GetWindowWidth() / 2, Game.GetWindowHeight() / 2, 50, 50);
            cat.AddTextures(GResource.lcat, Cat.STATE.LEFT);
            cat.AddTextures(GResource.rcat, Cat.STATE.RIGHT);
            cat.Bump();
            cat.SetChristmasTree(tree);
            //	AddElement(imageCat);
        }
Пример #2
0
        public override void Resume()
        {
            GResource.LoadTextures();

            imgLMD = new GImage(Game);
            imgLMD.SetTexture(GResource.game_fon);
            imgLMD.SetWidth(250);
            imgLMD.SetHeight(200);
            imgLMD.SetX(Game.GetWindowWidth() / 2);
            imgLMD.SetY(Game.GetWindowHeight() / 2 + 100);
            AddElement(imgLMD);

            CircleButton but = new CircleButton(Game);

            but.onClick += ScreenStart_onClick;
            but.SetX(Game.GetWindowWidth() / 2);
            but.SetY(150);
            but.SetRadius(80);
            but.SetImage(GImage.LoadTexture(@"C:\Users\User\Desktop\WarBugs\button_play.png"));

            GameFramewerk.UI.Animations.AnimationScale anim = new GameFramewerk.UI.Animations.AnimationScale();
            anim.Initialize(but.GetWidth(), but.GetHeight(), but.GetWidth() + 20, but.GetHeight() + 20, 4, 4, but);

            AddElement(but);
        }
Пример #3
0
        public ScreenLoading(IGame game) : base(game)
        {
            image = new GImage(game);
            image.SetWidth(100);
            image.SetHeight(100);
            image.SetX(200);
            image.SetY(100);
            image.SetImage(GameResource.text_lmd);

            AddElement(image);
        }
Пример #4
0
        public void AddDecoration(float x, float y, float w, float h, uint texture)
        {
            GImage img = new GImage(game);

            img.SetTexture(texture);
            img.SetX(x);
            img.SetY(y);
            img.SetWidth(w);
            img.SetHeight(h);
            img.UserObject = "decoration";
            Decorations.Add(img);
        }
Пример #5
0
        private GImage CreateImage(float x, float y, float width, float height, Bitmap b_img)
        {
            GImage img = new GImage(Game);

            img.SetWidth(width);
            img.SetHeight(height);
            img.SetImage(b_img);
            img.SetX(x);
            img.SetY(y);
            AddElement(img);

            return(img);
        }
Пример #6
0
        public override void Resume()
        {
            imgLMD = new GImage(Game);
            imgLMD.SetImage(GameResource.text_lmd);
            imgLMD.SetWidth(50);
            imgLMD.SetHeight(1);
            imgLMD.SetX(Game.GetWindowWidth() / 2 + 90);
            imgLMD.SetY(200);
            ScaleImg_x = imgLMD.GetWidth();
            ScaleImg_y = imgLMD.GetHeight();
            AddElement(imgLMD);

            intent_to_menu = new Intent(Game);
            intent_to_menu.SetScreenLoading(null);
        }
Пример #7
0
        public Cat(IGame game, float x, float y, float w, float h)
        {
            EnableAnimation = false;

            if (x > game.GetWindowWidth())
            {
                State = STATE.RIGHT;
            }
            else
            {
                State = STATE.LEFT;
            }

            texturesL = new uint[16];
            texturesR = new uint[16];

            image = new GImage(game);
            image.SetWidth(w);
            image.SetHeight(h);
            image.SetX(x);
            image.SetY(y);
        }
Пример #8
0
        public override void Resume()
        {
            // Initialize particle parameters
            partParams    = new GSystemParticles.ParticleParameters[1];
            partParams[0] = new GSystemParticles.ParticleParameters()
            {
                Type   = GSystemParticles.TypeParticle.Circle,
                Color  = Color.DarkTurquoise,
                TTL    = 100,
                radius = 10
            };

            // Initialize Physics
            Game.GetPhysics().Initialize(-1000, -1000, 1000, 1000, 0, 0, false);
            Game.GetPhysics().GetSolver().onAdd += ScreenGame_onAdd;

            // Create circles
            InfoBody foeBody = Game.GetPhysics().AddCircle(Game.GetWindowWidth() / 2, 100, 50, 0, 1f, 1f, 1f, GameResource.circle_3, "I");

            myBody   = Game.GetPhysics().AddCircle(Game.GetWindowWidth() / 2, Game.GetWindowHeight() - 100, 50, 0, 1f, 1f, 1f, GameResource.circle_1, "FOE");
            ballBody = Game.GetPhysics().AddCircle(Game.GetWindowWidth() / 2, Game.GetWindowHeight() / 2 + 40, 30, 0, 1f, 1f, 1f, GameResource.circle_2, "BALL");
            LFoe     = new LogicFoe(Game, foeBody, ballBody);

            // Create borders
            Game.GetPhysics().AddRect(0, Game.GetWindowHeight() / 2, 20, Game.GetWindowHeight(), 0, 0f, 0f, 0f, GameResource.rect_3, "BORDER");
            Game.GetPhysics().AddRect(Game.GetWindowWidth() - 15, Game.GetWindowHeight() / 2, 20, Game.GetWindowHeight(), 0, 0f, 0f, 0f, GameResource.rect_3, "BORDER");

            // Decor
            image_line = new GImage(Game);
            image_line.SetImage(GameResource.rect_1);
            image_line.SetX(Game.GetWindowWidth() / 2);
            image_line.SetY(Game.GetWindowHeight() / 2);
            image_line.SetWidth(Game.GetWindowWidth());
            image_line.SetHeight(10);

            // Create intent to menu
            Intent intent_to_menu = new Intent(Game);

            intent_to_menu.SetScreenLoading(null);

            // Create top panel
            topPanel = new GTopPanel(Game);
            topPanel.ClearBalls();
            topPanel.onCommand += (cmd) =>
            {
                switch (cmd)
                {
                case GTopPanel.CommandTopPanel.menu:
                    intent_to_menu.screenFrom = this;
                    intent_to_menu.screenTo   = new ScreenMenu(Game);
                    intent_to_menu.Start();
                    break;

                case GTopPanel.CommandTopPanel.play:
                    IsPause = false;
                    break;

                case GTopPanel.CommandTopPanel.pause:
                    IsPause = true;
                    break;
                }
            };
            AddElement(topPanel);
        }