Пример #1
0
        public RayParticle(Vector2 position, bool moveLeft, Unit owner)
        {
            this.Position = position;

            this.SpriteSheet = TextureLoader.RaySprite;
            this.TextureWidth = RayParticleTextureWidth;
            this.TextureHeight = RayParticleTextureHeight;

            this.SourceRect = new Rectangle(0, 0, this.TextureWidth, this.TextureHeight);

            this.OffsetX = 0;
            this.OffsetY = RayParticleInitialOffsetY;
            this.IsFacingLeft = moveLeft;

            if (this.IsFacingLeft)
            {
                this.BoundingBox = new Rectangle(
                    (int)this.X,
                    (int)this.Y,
                    this.OffsetX,
                    this.OffsetY);
            }
            else
            {
                this.BoundingBox = new Rectangle(
                    (int)this.Position.X - RayParticleMaxExpandSize,
                    (int)this.Position.Y,
                    this.OffsetX,
                    this.OffsetY);
            }

            this.Owner = owner;
        }
Пример #2
0
        public GhostProjectile(Vector2 position, bool moveLeft, Unit owner)
            : base()
        {
            this.Position = position;

            this.SpriteSheet = TextureLoader.GhostProjectileSheet;
            this.TextureWidth = GhostProjectileTextureWidth;
            this.TextureHeight = GhostProjectileTextureHeight;

            this.IsFacingLeft = moveLeft;
            if (this.IsFacingLeft)
            {
                this.SourceRect = new Rectangle(0 * GhostProjectileTextureWidth, GhostProjectileTextureHeight * 0, GhostProjectileTextureWidth, GhostProjectileTextureHeight);
            }
            else
            {
                this.SourceRect = new Rectangle(0 * GhostProjectileTextureWidth, GhostProjectileTextureHeight * 1, GhostProjectileTextureWidth, GhostProjectileTextureHeight);
            }

            this.DefaultMovementSpeed = GhostProjectileDefaultMovementSpeed;
            this.MovementSpeed = this.DefaultMovementSpeed;

            this.BoundingBox = new Rectangle(
                (int)this.X,
                (int)this.Y,
                this.TextureWidth,
                this.TextureHeight);

            this.Owner = owner;
        }