예제 #1
0
        public override IEntity Clone()
        {
            bool      direction = Velocity.X > 0;
            EnemyFire fireball  = new EnemyFire(Texture, direction);
            IEntity   clone     = fireball;

            base.Clone(ref clone);
            return(clone);
        }
예제 #2
0
        public EnemyFire MakeFireball(Vector2 position, int dir)
        {
            bool facing = dir >= 2;

            Vector2 pos;

            if (facing)
            {
                pos = new Vector2(position.X + 32 + 2, position.Y - 30);
            }
            else
            {
                pos = new Vector2(position.X - fireball.Width - 1, position.Y - 30);
            }
            EnemyFire fb = new EnemyFire(fireball, facing)
            {
                Position = pos
            };
            Rectangle source = fb.SourceRectangle;

            source.Width      /= 2;
            fb.SourceRectangle = source;
            return(fb);
        }