Example #1
0
        public BarManager(Game game) : base(game)
        {
            TriangleBar temp = new TriangleBar(this.Game,

                                               new Vector2[2]
            {
                new Vector2(0, -1 / 3),
                new Vector2(1 / 3, 0)
            }

                                               );

            bars.Add(temp);
        }
Example #2
0
        public BarCollisionResult CheckCollision(Beat beat, int barID)
        {
            TriangleBar barToCheck = bars[barID];

            if (barToCheck.Intersects(beat.LocationRect))
            {
                if (beat.State == barToCheck.BarState)
                {
                    return(BarCollisionResult.RightSide);
                }
                return(BarCollisionResult.WrongSide);
            }
            return(BarCollisionResult.NoCollision);
        }
Example #3
0
        public BarManager(Game game, Vector2[] basisVectors, int numBars) : base(game)
        {
            for (int i = 0; i < numBars; i++)
            {
                Vector2 LeftPos = basisVectors[0] + (
                    -basisVectors[1] + i * ((2 * basisVectors[1]) / numBars)
                    );
                Vector2[] positions = new Vector2[3] {
                    new Vector2(0, 0),
                    LeftPos,
                    LeftPos + ((2 * basisVectors[1]) / numBars)
                };

                TriangleBar temp = new TriangleBar(this.Game, positions);
                temp.BarState = GetStateFromInt(i % BarSideCount);

                bars.Add(temp);
            }
        }