コード例 #1
0
        public override void Initialize()
        {
            Vector2[] basisVectors = new Vector2[2] {
                new Vector2(0, Game.GraphicsDevice.Viewport.Height / 6), new Vector2(GraphicsDevice.Viewport.Width / 6, 0)
            };
            switch (compassLocation)
            {
            case RowCompassLocation.South:
                basisVectors[0] = new Vector2(0, -Game.GraphicsDevice.Viewport.Height / 6);
                break;

            case RowCompassLocation.East:
                basisVectors = new Vector2[2] {
                    new Vector2(GraphicsDevice.Viewport.Width / 6, 0), new Vector2(0, -Game.GraphicsDevice.Viewport.Height / 6)
                };
                break;

            case RowCompassLocation.West:
                basisVectors = new Vector2[2] {
                    new Vector2(-GraphicsDevice.Viewport.Width / 6, 0), new Vector2(0, -Game.GraphicsDevice.Viewport.Height / 6)
                };
                break;
            }

            barM = new BarManager(Game, basisVectors, laneCount);
            barM.Initialize();

            beatM = new BeatManager(Game, barM, rowRectangle, laneCount, compassLocation);
            beatM.Initialize();
            base.Initialize();
        }
コード例 #2
0
ファイル: BeatManager.cs プロジェクト: maniacalspy/BeatBars
        public BeatManager(Game game, BarManager barManager, Rectangle region, int laneCount, RowCompassLocation compassLocation) : base(game)
        {
            bM              = barManager;
            beatsToRemove   = new List <Beat>();
            wrongbeats      = new List <Beat>();
            beatsRowID      = new Dictionary <Beat, int>();
            LaneSpawnPoints = new List <Vector2>();
            Vector2 SpawnPointOffSet = new Vector2(0, 0);

            switch (compassLocation)
            {
            case RowCompassLocation.North:
                speed            = 30f;
                SpawnPointOffSet = new Vector2(0, -region.Height);
                break;

            case RowCompassLocation.South:
                speed            = 30f;
                SpawnPointOffSet = new Vector2(0, region.Height);
                break;

            case RowCompassLocation.East:
                speed            = 50f;
                SpawnPointOffSet = new Vector2(region.Width, 0);
                break;

            case RowCompassLocation.West:
                speed            = 50f;
                SpawnPointOffSet = new Vector2(-region.Width, 0);
                break;
            }
            progressionDirection = -SpawnPointOffSet;
            progressionDirection.Normalize();
            for (int i = 0; i < laneCount; i++)
            {
                Vector2 point = barManager.getBarMidPointByIndex(i) + SpawnPointOffSet;
                LaneSpawnPoints.Add(point);
            }
        }