Example #1
0
        private void DrawGlassBlock(GlassBlockBlueprint c)
        {
            var x1 = (c.X - c.Width / 2) / 64;
            var y1 = (c.Y - c.Height / 2) / 64;
            var x2 = (c.X + c.Width / 2) / 64;
            var y2 = (c.Y + c.Height / 2) / 64;

            FillMapRot(x1, y1, x2, y2, c.Rotation, 'H');
        }
Example #2
0
        public GlassBlock(GDGameScreen scrn, GlassBlockBlueprint blueprint) : base(scrn, GDConstants.ORDER_GAME_WALL)
        {
            Blueprint = blueprint;

            var pos = new FPoint(blueprint.X, blueprint.Y);

            _width    = blueprint.Width;
            _height   = blueprint.Height;
            _rotation = FloatMath.ToRadians(blueprint.Rotation);

            _bounds = new FRotatedRectangle(pos, _width, _height, _rotation);

            Position = pos;

            DrawingBoundingBox = _bounds.OuterSize;

            this.GDOwner().GDBackground.RegisterBlockedBlock(_bounds.WithNoRotation(), _rotation);
        }