public override bool Powerup_PerformFrame(BCBlockGameState gamestate) { GravityEffect = new PointF(0, 0); if (gsw == null) gsw = new GameStopwatch(gamestate); //throw new NotImplementedException(); //Location = new PointF(Location.X + Velocity.X, Location.Y + Velocity.Y); //get current time... long elapsedticks = gsw.Elapsed.Ticks; long lengthticks = Poptime.Ticks; //first, if our time is up, we're done. if (elapsedticks > lengthticks || Math.Abs(Velocity.Y) < 0.1f) { //spawn some particles. for (int i = 0; i < 10; i++) { EmitterParticle createdemitter = new EmitterParticle(this.GetRectangleF().CenterPoint(), Defaultemitterroutine); createdemitter.Velocity = BCBlockGameState.GetRandomVelocity(0, 5); gamestate.Particles.Add(createdemitter); } gamestate.SpawnOrbs(45, GetRectangleF().CenterPoint(), typeof(MacGuffinOrb)); gamestate.NextFrameCalls.Enqueue(new BCBlockGameState.NextFrameStartup(() => gamestate.GameObjects.Remove(this))); return true; //destroy us NAU... } else { //get percentage through... float percentcomplete = ((float)elapsedticks) / ((float)lengthticks); //set velocity.Y to -(1-Sin(percentcomplete)... //Velocity = new PointF(Velocity.X, -2*(float)(Math.Abs(1 - Math.Sin(percentcomplete)))); if(Velocity.Y < 0) Velocity = new PointF(Velocity.X, Velocity.Y +0.5f); Debug.Print("percentage through:" + percentcomplete + Velocity); } Debug.Print("Velocity is " + Velocity); return false; }