public override void Update(BaseScene scene, FrameTick elapsedTime) { base.Update(scene, elapsedTime); if (Finished && ResultAnim.AnimIndex != "") { int totalTime = ResultAnim.FrameTime * ResultAnim.GetTotalFrames(GraphicsManager.GetAttackSheet(ResultAnim.AnimIndex).TotalFrames); WrappedRainAnim anim = new WrappedRainAnim(ResultAnim, totalTime); anim.SetupEmitted(MapLoc, 0, Dir8.None); scene.Anims[(int)Layer].Add(anim); } }
public override void Update(BaseScene scene, FrameTick elapsedTime) { CurrentBurstTime += elapsedTime; while (CurrentBurstTime >= Math.Max(1, BurstTime)) { CurrentBurstTime -= Math.Max(1, BurstTime); for (int ii = 0; ii < ParticlesPerBurst; ii++) { Loc startLoc = new Loc(MathUtils.Rand.Next(GraphicsManager.ScreenWidth), MathUtils.Rand.Next(GraphicsManager.ScreenHeight * 2)); int height = startLoc.Y; int time = (height - 1) * GraphicsManager.MAX_FPS / -HeightSpeed;// + 1; startLoc += scene.ViewRect.Start; WrappedRainAnim anim = new WrappedRainAnim(Anim, ResultAnim, Layer, time); anim.SetupEmitted(startLoc, new Loc(SpeedDiff, 0), Loc.Zero, height, HeightSpeed, 0, Dir); scene.Anims[(int)Layer].Add(anim); } } }