public static void DrawImpact(SceneGame scene, MapTile target, Color a, Color b, float appear) { var cursor = SpriteLoader.Instance.AddSprite("content/effect_area_target"); float flash = 0.5f + (float)Math.Sin(scene.Frame / 10f) * 0.5f; Color color = Color.Lerp(a.WithAlpha(appear), b.WithAlpha(appear), flash); var pos = target.GetVisualPosition(); scene.DrawSprite(cursor, (int)(scene.Frame * 0.25f), pos, SpriteEffects.None, color, 0); }
private void DrawTarget(SceneGame scene) { var line = SpriteLoader.Instance.AddSprite("content/line_dotted"); var cursor = SpriteLoader.Instance.AddSprite("content/effect_area_target"); var start = AnchorStart; var end = AnchorEnd; scene.PushSpriteBatch(blendState: BlendState.Additive); float flash = 0.5f + (float)Math.Sin(scene.Frame / 10f) * 0.5f; Color color = Color.Lerp(Color.IndianRed, Color.Orange, flash); var curve = GetStraight(start, end); scene.DrawBeamCurve(line, curve, 100, (slide) => 0.5f, 2, scene.Frame, 0.0f, 1.0f, ColorMatrix.Tint(color), BlendState.Additive); var pos = Target.GetVisualPosition(); scene.DrawSprite(cursor, (int)(scene.Frame * 0.25f), pos, SpriteEffects.None, color, 0); scene.PopSpriteBatch(); }