Sprite.destroy C# (CSharp) Method

destroy() public method

public destroy ( ) : void
return void
    public override void destroy()
    {
        base.destroy ();
        _texture	= null;
    }

Usage Example

Example #1
0
        public override void tick(ArrayList sprites, Sprite sprite, Game game)
        {
            if (target == null)
            {
                foreach (Sprite csp in sprites)
                {
                    if (csp is TankSprite && csp != sprite)
                    {
                        target = csp;
                    }
                }
            }

            int xinc = lookup[direction, 0] * velocity;
            int yinc = lookup[direction, 1] * velocity;

            x = x + xinc;
            y = y + yinc;

            if (target != null)
            {
                x = target.getX() + 10;
                y = target.getY() + 10;
            }

            if (lifeTime-- == 0)
            {
                sprite.destroy();
            }
        }
All Usage Examples Of Sprite::destroy