本文整理汇总了C#中BCBlockGameState.SpawnOrbs方法的典型用法代码示例。如果您正苦于以下问题:C# BCBlockGameState.SpawnOrbs方法的具体用法?C# BCBlockGameState.SpawnOrbs怎么用?C# BCBlockGameState.SpawnOrbs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BCBlockGameState
的用法示例。
在下文中一共展示了BCBlockGameState.SpawnOrbs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Powerup_PerformFrame
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;
}