FBClient.Core.Entities.Bomb.Bomb C# (CSharp) Method

Bomb() public method

public Bomb ( int playerId, Point cellPosition, int pow, System.TimeSpan timer, float playerSpeed ) : System
playerId int
cellPosition Point
pow int
timer System.TimeSpan
playerSpeed float
return System
        public Bomb(int playerId, Point cellPosition, int pow, TimeSpan timer, float playerSpeed)
            : base(playerId, cellPosition, pow, timer, playerSpeed)
        {
            // TODO: Move all loading of content into a LoadContent XNA method like
            // Bomb Sprite
            var spriteTexture = FinalBomber.Instance.Content.Load<Texture2D>("Graphics/Sprites/bomb");
            var animation = new Animation(3, 32, 32, 0, 0, 3);
            Sprite = new AnimatedSprite(spriteTexture, animation)
            {
                IsAnimating = true
            };

            // Bomb's explosion animations
            _explosionSpriteTexture = FinalBomber.Instance.Content.Load<Texture2D>("Graphics/Sprites/explosion");
            const int explosionAnimationsFramesPerSecond = 10;
            _explosionAnimations = new[]
            {
                new Animation(4, 32, 32, 0, 0, explosionAnimationsFramesPerSecond),
                new Animation(4, 32, 32, 0, 32, explosionAnimationsFramesPerSecond),
                new Animation(4, 32, 32, 0, 64, explosionAnimationsFramesPerSecond),
                new Animation(4, 32, 32, 0, 96, explosionAnimationsFramesPerSecond),
                new Animation(4, 32, 32, 0, 128, explosionAnimationsFramesPerSecond),
                new Animation(4, 32, 32, 0, 160, explosionAnimationsFramesPerSecond),
                new Animation(4, 32, 32, 0, 192, explosionAnimationsFramesPerSecond)
            };

            _explosionAnimationsDirection = new Dictionary<Point, ExplosionDirection>();

            // Bomb's states
            _cellTeleporting = false;
            _lastPlayerThatPushIt = -1;

            // Sounds
            _bombExplosionSound = FinalBomber.Instance.Content.Load<SoundEffect>("Audio/Sounds/boom");
        }