コード例 #1
0
        public void DrawBackground(SpriteBatch batch, BackGroundTypes bgType)
        {
            var y = 0;

            for (var j = 0; j < (int)(Game.Height / Types.GetBackGround(bgType).Height) + 1; j++)
            {
                var x = 0;
                for (var i = 0; i < (int)(Game.Width / Types.GetBackGround(bgType).Width) + 1; i++)
                {
                    batch.Draw(Types.GetBackGround(bgType),
                               new Vector2(x, y),
                               Color.Lerp(Color.Black, Color.White, Fade.Fade));
                    x += (int)Types.GetBackGround(bgType).Width;
                }
                y += (int)Types.GetBackGround(bgType).Height;
            }
            batch.Draw(Textures.CmnFade, null, new Rectangle(Bounds.Right, 0, (int)Game.Width - Bounds.Right, (int)Game.Height), null, null, 0, null, null);

            /*
             * var y = 0;
             * for (var j = 0; j < (int) (Game.Height/Types.GetBackGround(bgType).Height) + 1; j++)
             * {
             *  var x = Sprites.BrkWhite.Width*Game.Game.BlocksWide;
             *  for (var i = 0; i < Bounds.Width/Types.GetBackGround(bgType).Width; i++)
             *  {
             *      x -= (int) Types.GetBackGround(bgType).Width;
             *      batch.Draw(Types.GetBackGround(bgType),
             *          new Vector2(Bounds.X + x, Bounds.Y + y),
             *          Color.Lerp(Color.Black, Color.White, Fade.Fade));
             *  }
             *  y += (int) Types.GetBackGround(bgType).Height;
             * }
             */
        }
コード例 #2
0
 public PlayerSelectArena(Arkanoid game, BackGroundTypes backGround) : base(game)
 {
     BackGround = backGround;
     MenuItems  = new[] { Textures.Cmn1Player, Textures.Cmn2Player, Textures.CmnBack };
     foreach (var texture in MenuItems)
     {
         MenuHeight += texture.Height;
     }
 }
コード例 #3
0
        public MenuArenaSelector(Arkanoid game, bool twoPlayer, BackGroundTypes backGround) : base(game)
        {
            BackGround = backGround;
            TwoPlayer  = twoPlayer;
            var menu = Levels.Levels.Wads.Select(wad => wad.Title).ToList();

            menu.Add(Textures.CmnBack);
            MenuItems = menu.ToArray();
            foreach (var texture in MenuItems)
            {
                MenuHeight += texture.Height;
            }
        }
コード例 #4
0
ファイル: MenuArena.cs プロジェクト: pixelwhipped/ArkanoidDX
 public MenuArena(Arkanoid game, BackGroundTypes?background = null) : base(game)
 {
     BackGround = background ?? RandomUtils.RandomEnum <BackGroundTypes>();
     Levels.Levels.LoadWads(Game, Game.GraphicsDevice, Game.Content);
     Levels.Levels.UpdateCustom(Game);
     Demo = new TimeSpan(0, 0, 0, 30);
     Game.Sounds.IntroMusic.Play();
     MenuItems = new[] { Textures.CmnStart, Textures.CmnEdit, Textures.CmnCredits, Textures.CmnExit };
     foreach (var texture in MenuItems)
     {
         MenuHeight += texture.Height;
     }
 }
コード例 #5
0
 public CreditsArena(Arkanoid game, BackGroundTypes backGround)
     : base(game)
 {
     Show    = new TimeSpan(0, 0, 0, 15);
     Credits = new List <string>
     {
         "Lead Developer",
         "Benjamin Tarrant",
         "I",
         "Creative Concepts and Levels",
         "Chloe Tarrant",
         "Jansen Tarrant",
         "Benjamin Tarrant",
         "I",
         "Deticated To",
         "Aurora and Ianeta Tarrant"
     };
 }
コード例 #6
0
ファイル: LoadArena.cs プロジェクト: pixelwhipped/ArkanoidDX
        public LoadArena(Arkanoid game, LevelWad wad, BackGroundTypes backGround, bool twoPlayer)
            : base(game)
        {
            TwoPlayer       = twoPlayer;
            BackGround      = backGround;
            Wad             = wad;
            LevelNumber     = game.Settings.Unlocks.ContainsKey(wad.Name) ? game.Settings.Unlocks[wad.Name].LevelScores.Count : 0;
            MaxLevel        = LevelNumber;
            LeftLevelOffset = new Vector2(Bounds.Center.X - (Textures.CmnSmallFrameCustom.Width + 20),
                                          Bounds.Center.Y - Textures.CmnSmallFrameCustom.Height / 2f);

            RightLevelOffset = new Vector2(Bounds.Center.X, LeftLevelOffset.Y);
            RightButton      = new Vector2(RightLevelOffset.X + (Textures.CmnSmallFrame.Width + 20),
                                           LeftLevelOffset.Y - Textures.CmnRight.Height + Textures.CmnSmallFrame.Height / 2f);
            LeftButton = new Vector2(LeftLevelOffset.X - (Textures.CmnLeft.Width + 20),
                                     LeftLevelOffset.Y - Textures.CmnLeft.Height + Textures.CmnSmallFrame.Height / 2f);
            ExitOffset = new Vector2(Bounds.Center.X - Textures.CmnBack.Width / 2f,
                                     LeftLevelOffset.Y + Textures.CmnSmallFrame.Height + 20);

            TitleOffset = new Vector2(Bounds.Center.X - wad.Title.Width / 2f,
                                      LeftLevelOffset.Y - (wad.Title.Height + 20));

            Left = wad.Levels[LevelNumber].Key != null;
        }
コード例 #7
0
        public static Sprite GetBackGround(BackGroundTypes type)
        {
            switch (type)
            {
            case BackGroundTypes.Doh:
            {
                return(Sprites.BgDoh);
            }

            case BackGroundTypes.PurpleCircuit:
            {
                return(Sprites.BgPurpleCircuit);
            }

            case BackGroundTypes.RedCircuit:
            {
                return(Sprites.BgRedCircuit);
            }

            case BackGroundTypes.DarkRedCircuit:
            {
                return(Sprites.BgDarkRedCircuit);
            }

            case BackGroundTypes.BlueCircuit:
            {
                return(Sprites.BgBlueCircuit);
            }

            case BackGroundTypes.DarkBlueCircuit:
            {
                return(Sprites.BgDarkBlueCircuit);
            }

            case BackGroundTypes.CellularGreen:
            {
                return(Sprites.BgCellularGreen);
            }

            case BackGroundTypes.DarkCellularGreen:
            {
                return(Sprites.BgDarkCellularGreen);
            }

            case BackGroundTypes.BlueHex:
            {
                return(Sprites.BgBlueHex);
            }

            case BackGroundTypes.DarkBlueHex:
            {
                return(Sprites.BgDarkBlueHex);
            }

            case BackGroundTypes.DarkTech:
            {
                return(Sprites.BgDarkTech);
            }

            case BackGroundTypes.GreySkin:
            {
                return(Sprites.BgGreySkin);
            }

            case BackGroundTypes.GoldHive:
            {
                return(Sprites.BgGoldHive);
            }

            case BackGroundTypes.RedInnards:
            {
                return(Sprites.BgRedInnards);
            }

            case BackGroundTypes.GreenWeave:
            {
                return(Sprites.BgGreenWeave);
            }

            case BackGroundTypes.GreyBevelHex:
            {
                return(Sprites.BgGreyBevelHex);
            }

            default:
            {
                return(Sprites.BgBlueHex);
            }
            }
        }