Beispiel #1
0
        public CShadower(SPGame mGame, CBody mCBody, bool mIsDrawn, Color mColor, int mMultiplier = 35)
        {
            _game = mGame;
            _cBody = mCBody;
            _isDrawn = mIsDrawn;
            _color = mColor;
            _vertexArrays = new List<Vertex[]>();
            ShadowCaster = new ShadowCaster(_cBody.Position, mMultiplier);

            if (_isDrawn) _game.AddDrawAction(Draw, -10);
        }
Beispiel #2
0
        public CShadower(SPGame mGame, CBody mCBody, bool mIsDrawn, Color mColor, int mMultiplier = 35)
        {
            _game         = mGame;
            _cBody        = mCBody;
            _isDrawn      = mIsDrawn;
            _color        = mColor;
            _vertexArrays = new List <Vertex[]>();
            ShadowCaster  = new ShadowCaster(_cBody.Position, mMultiplier);

            if (_isDrawn)
            {
                _game.AddDrawAction(Draw, -10);
            }
        }
Beispiel #3
0
        public override void Added()
        {
            var x = _cBody.X.ToPixels();
            var y = _cBody.Y.ToPixels();

            Sprite = new Sprite(Assets.GetTexture(_textureName));
            if (_tilesetName != null && _labelName != null)
            {
                Sprite.TextureRect = Assets.GetTileset(_tilesetName).GetTextureRect(_labelName);
            }
            Sprite.Rotation = _rotation;
            Sprite.Position = new Vector2f(x, y);
            Sprite.Origin   = new Vector2f(Sprite.GetGlobalBounds().Width / 2, Sprite.GetGlobalBounds().Height / 2);

            _game.AddDrawAction(Draw);
        }
Beispiel #4
0
 public override void Added()
 {
     _game.AddDrawAction(Draw, -9);
 }