Beispiel #1
0
        protected override void OnDrawOrderedForegroundLayer(IBatchRenderer sbatch)
        {
            switch (ObstacleType)
            {
            case ObstacleStubType.BlackHole:
                // NOP
                break;

            case ObstacleStubType.WhiteHole:
                // NOP
                break;

            case ObstacleStubType.GlassBlock:
                break;

            case ObstacleStubType.MirrorBlock:
                // NOP
                break;

            case ObstacleStubType.MirrorCircle:
                // NOP
                break;

            case ObstacleStubType.VoidVircle:
                CommonObstacleRenderer.DrawVoidCircle_FG(sbatch, Position, Width);
                break;

            default:
                SAMLog.Error("LEOS::EnumSwitch_CS_ODOFL", "ObstacleType = " + ObstacleType);
                break;
            }
        }
Beispiel #2
0
        protected override void OnDraw(IBatchRenderer sbatch)
        {
            CommonObstacleRenderer.DrawPortal(sbatch, _renderRects, Color, Normal);

#if DEBUG
            if (DebugSettings.Get("DebugEntityBoundaries"))
            {
                sbatch.FillCircle(Position, 4, 16, Color.Turquoise);
                sbatch.DrawLine(Position, Position + Vector2.UnitX.RotateWithLength(Normal, 32), Color.Turquoise, 2);
            }
#endif
        }
Beispiel #3
0
        protected override void OnDraw(IBatchRenderer sbatch)
        {
            if (GDOwner.Selection == this)
            {
                sbatch.FillShape(GetArea().AsInflated(GDConstants.TILE_WIDTH / 2, GDConstants.TILE_WIDTH / 2), Color.Black * 0.333f);
            }

            if (_ppCacheKey != EquatableTuple.Create(Length, Normal, Position))
            {
                _ppCacheKey   = EquatableTuple.Create(Length, Normal, Position);
                _ppCacheRects = CommonObstacleRenderer.CreatePortalRenderRects(Position, Vector2.UnitX.Rotate(Normal), Vector2.UnitX.Rotate(Normal).RotateWithLength(FloatMath.RAD_POS_090, Length / 2f), Length);
            }

            CommonObstacleRenderer.DrawPortal(sbatch, _ppCacheRects, Portal.COLORS[Group], Normal);
        }
Beispiel #4
0
        protected override void OnDraw(IBatchRenderer sbatch)
        {
            if (GDOwner.Selection == this)
            {
                if (ObstacleType == ObstacleStubType.MirrorBlock || ObstacleType == ObstacleStubType.GlassBlock)
                {
                    var a = FRotatedRectangle.CreateByCenter(Position, Width, Height, Rotation).GetBoundingRectangle();
                    sbatch.DrawCentered(Textures.TexPixel, Position, a.Width + GDConstants.TILE_WIDTH, a.Height + GDConstants.TILE_WIDTH, Color.Black * 0.333f);
                }
                else
                {
                    sbatch.DrawCentered(Textures.TexPixel, Position, Width + GDConstants.TILE_WIDTH, Height + GDConstants.TILE_WIDTH, Color.Black * 0.333f);
                }
            }

            switch (ObstacleType)
            {
            case ObstacleStubType.BlackHole:
                CommonObstacleRenderer.DrawBlackHole(sbatch, Position, Lifetime, Width, -Power);
                break;

            case ObstacleStubType.WhiteHole:
                CommonObstacleRenderer.DrawBlackHole(sbatch, Position, Lifetime, Width, Power);
                break;

            case ObstacleStubType.GlassBlock:
                CommonObstacleRenderer.DrawGlassBlock(sbatch, FRotatedRectangle.CreateByCenter(Position, Width, Height, Rotation));
                break;

            case ObstacleStubType.MirrorBlock:
                CommonObstacleRenderer.DrawMirrorBlock(sbatch, FRotatedRectangle.CreateByCenter(Position, Width, Height, Rotation));
                break;

            case ObstacleStubType.MirrorCircle:
                CommonObstacleRenderer.DrawMirrorCircle(sbatch, Position, Width);
                break;

            case ObstacleStubType.VoidVircle:
                CommonObstacleRenderer.DrawVoidCircle_BG(sbatch, Position, Width);
                break;

            default:
                SAMLog.Error("LEOS::EnumSwitch_CS_OD", "ObstacleType = " + ObstacleType);
                break;
            }
        }
Beispiel #5
0
        public Portal(GDGameScreen scrn, PortalBlueprint blueprint) : base(scrn, GDConstants.ORDER_GAME_PORTAL)
        {
            var pos = new FPoint(blueprint.X, blueprint.Y);

            Normal       = FloatMath.DegreesToRadians * blueprint.Normal;
            VecNormal    = Vector2.UnitX.Rotate(Normal);
            Length       = blueprint.Length;
            VecDirection = VecNormal.RotateWithLength(FloatMath.RAD_POS_090, blueprint.Length / 2f);
            Color        = COLORS[blueprint.Group];
            _group       = blueprint.Group;
            _side        = blueprint.Side;

            Position = pos;

            DrawingBoundingBox = new Vector2(Length, 0).Rotate(Normal + FloatMath.RAD_POS_090).ToAbsFSize().AtLeast(WIDTH, WIDTH);

            this.GDOwner().GDBackground.RegisterBlockedLine(pos - Vector2.UnitX.RotateWithLength(Normal + FloatMath.RAD_POS_090, Length / 2f), pos + Vector2.UnitX.RotateWithLength(Normal + FloatMath.RAD_POS_090, Length / 2f));

            _renderRects = CommonObstacleRenderer.CreatePortalRenderRects(pos, VecNormal, VecDirection, Length);
        }
Beispiel #6
0
 protected override void OnDraw(IBatchRenderer sbatch)
 {
     CommonObstacleRenderer.DrawMirrorCircle(sbatch, Position, _diameter);
 }
Beispiel #7
0
 protected override void OnDrawOrderedForegroundLayer(IBatchRenderer sbatch)
 {
     CommonObstacleRenderer.DrawVoidCircle_FG(sbatch, Position, _diameter);
 }
Beispiel #8
0
 protected override void OnDraw(IBatchRenderer sbatch)
 {
     CommonObstacleRenderer.DrawMirrorBlock(sbatch, _bounds);
 }
Beispiel #9
0
 protected override void OnDraw(IBatchRenderer sbatch)
 {
     CommonObstacleRenderer.DrawBlackHole(sbatch, Position, _animationTimer, _diameter, _power);
 }