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


C# Path.AddPath方法代码示例

本文整理汇总了C#中Path.AddPath方法的典型用法代码示例。如果您正苦于以下问题:C# Path.AddPath方法的具体用法?C# Path.AddPath怎么用?C# Path.AddPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Path的用法示例。


在下文中一共展示了Path.AddPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

    static void Main()
    {
        Path setPath = new Path();
        setPath.AddPath(new Point3D(3, 5, 6));
        setPath.AddPath(new Point3D(0, 0, 0));
        setPath.AddPath(new Point3D(0, 1, 514));

        PathStorage.SavePathsToFile(setPath.SeqOfPoints);

        PathStorage.ReadPathsFromFile();
    }
开发者ID:vassil,项目名称:CSharp,代码行数:11,代码来源:TestClass.cs

示例2: Update

        public void Update(GameTime gameTime)
        {
            if (!spawningPaused && !tutorial)
            {
                timer += (uint)gameTime.ElapsedGameTime.Milliseconds;
            }
            else if (!tutorial)
            {
                spawningPaused = !allEnemiesDead();
            }

            CheckSpawnQueue(gameTime);
            collisionManager.checkCollision();
            Vector2 tmpPlayerPosition = Vector2.Zero;

            for (int i = 0; i < entityList.Count; i++)
            {
                if (entityList[i].Type == EntityType.BOSS || entityList[i].Type == EntityType.NIGHTMARE || entityList[i].Type == EntityType.INNER_DEMON || entityList[i].Type == EntityType.LESSER_DEMON || entityList[i].Type == EntityType.DARK_WHISPER)
                {
                    if (player != null)
                    {
                        entityList[i].Target = player.position;
                    }
                }
                entityList[i].Update(gameTime);
                if (entityList[i].KillMe == true)
                {
                    killList.Add(entityList[i]);
                }
            }

            for (int i = 0; i < bulletList.Count; i++)
            {
                bulletList[i].Update(gameTime);
                if (bulletList[i].rangeExceded())
                {
                    bulletList.RemoveAt(i);
                }
            }

            if (killList.Count > 0)
            {
                RemoveEntity();
            }

            #region spawn_enemies_dev
            if(bool.Parse(game.config.getValue("Debug", "SpawnKeys")))
            {
                spawnEnemies.Update(gameTime);
                if (spawnEnemies.One == true)
                {
                    int count = EntityCount(EntityType.NIGHTMARE);
                    Nightmare nightmare = new Nightmare(spriteBatch, game, audioManager, this, "nightmare_spawned" + count.ToString());
                    nightmare.onDie += new Nightmare.PowerupReleaseHandle(ReleasePowerup);
                    nightmare.position.X = 0.0f;
                    float newY = random.Next(50, game.Window.ClientBounds.Bottom - 50);
                    nightmare.position.X = 0.0f;
                    nightmare.position.Y = newY;
                    while (addEntity(nightmare) == false)
                    {
                        count++;
                        nightmare.Alias = "nightmare" + count.ToString();
                    }
                }

                if (spawnEnemies.Two == true)
                {
                    int count = EntityCount(EntityType.BLUE_BLOOD_VESSEL);
                    BlueBloodvessel bloodvessel = new BlueBloodvessel(spriteBatch, game, audioManager, this, "bloodvessel_spawned" + count.ToString());
                    //bloodvessel.onDie += new BlueBloodvessel.PowerupReleaseHandle(ReleasePowerup);
                    bloodvessel.position.X = 0.0f;
                    float newY = random.Next(50, game.Window.ClientBounds.Bottom - 50);
                    bloodvessel.position.X = 0.0f;
                    bloodvessel.position.Y = newY;
                    while (addEntity(bloodvessel) == false)
                    {
                        count++;
                        bloodvessel.Alias = "bloodvessel" + count.ToString();
                    }

                }

                if (spawnEnemies.Three == true)
                {
                    int count = EntityCount(EntityType.DARK_THOUGHT);
                    Vector2 waypoint = new Vector2(100.0f, game.Window.ClientBounds.Center.Y);
                    Path waypoints = new Path(waypoint);
                    waypoint = new Vector2(200.0f, 200.0f);
                    waypoints.AddPath(waypoint);
                    waypoint = new Vector2(1000.0f, 600.0f);
                    waypoints.AddPath(waypoint);
                    DarkThought darkThought = new DarkThought(spriteBatch, game, audioManager, gameTime, "darkthought_spawned" + count.ToString(), this, waypoints);
                    darkThought.onDie += new DarkThought.PowerupReleaseHandle(ReleasePowerup);
                    darkThought.position.X = 100.0f;
                    darkThought.position.Y = 100.0f;
                    while (addEntity(darkThought) == false)
                    {
                        count++;
                        darkThought.Alias = "darkthought" + count.ToString();
                    }
//.........这里部分代码省略.........
开发者ID:rodstrom,项目名称:soul,代码行数:101,代码来源:EntityManager.cs


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