当前位置: 首页>>代码示例>>C#>>正文


C# BCBlockGameState.SpawnOrbs方法代码示例

本文整理汇总了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;
        }
开发者ID:BCProgramming,项目名称:BASeBlock,代码行数:43,代码来源:GameCharacter.cs


注:本文中的BCBlockGameState.SpawnOrbs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。