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


C# Level.addTask方法代码示例

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


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

示例1: LoadContent

        protected void LoadContent(bool loadAllContent)
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            levelOneTrue = 0;
            levelTwoTrue = 0;
            //load bbox images
            torch = Content.Load<Texture2D>("torch");
            fountain = Content.Load<Texture2D>("fountain");

            //load level images
            level1 = Content.Load<Texture2D>("level1");
            level2 = Content.Load<Texture2D>("level2");

            //load item bboxs
            torchBbox1 = new Bbox(torch, 600, 150, "fire");
            torchBbox2 = new Bbox(torch, 150, 150, "fire");
            fountainBbox = new Bbox(fountain, 250, 220, "water");

            //load levels
            levelOne = new Level(level1);
            levelTwo = new Level(level2);

            //right hand
            rightHand = new Bbox(handImage, righthandPosition.X, righthandPosition.Y, "normal");

            //fill level bbox lists
            levelOne.addBbox(torchBbox1);
            levelOne.addBbox(torchBbox2);
            levelTwo.addBbox(fountainBbox);

            //create tasks
            levelOneT1 = new CollisionTask(rightHand, torchBbox1, "fire");
            levelOneT2 = new CollisionTask(rightHand, torchBbox2, "fire");
            levelTwoT1 = new CollisionTask(rightHand, fountainBbox, "fire");

            //level one tasks
            levelOne.addTask(levelOneT1);
            levelOne.addTask(levelOneT2);

            //level two tasks
            levelTwo.addTask(levelTwoT1);
        }
开发者ID:rylancates,项目名称:Adventure-Game,代码行数:43,代码来源:Game1.cs

示例2: LoadContent

        protected void LoadContent(bool loadAllContent)
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            levelOneTrue = 0;
            levelTwoTrue = 0;
            //load bbox images
            torch = Content.Load<Texture2D>("torch");
            fountain = Content.Load<Texture2D>("fountain");

            //load level images
            level1 = Content.Load<Texture2D>("level1");
            level2 = Content.Load<Texture2D>("level2");

            //load item bboxs
            torchBbox1 = new Bbox(torch, 600, 150, "fire");
            torchBbox2 = new Bbox(torch, 150, 150, "fire");
            fountainBbox = new Bbox(fountain, 250, 220, "water");

            //load levels
            levelOne = new Level(level1);
            levelTwo = new Level(level2);

            //right hand
            rightHand = new Bbox(handImage, righthandPosition.X, righthandPosition.Y, "normal");

            //fill level bbox lists
            levelOne.addBbox(torchBbox1);
            levelOne.addBbox(torchBbox2);
            levelTwo.addBbox(fountainBbox);

            //create tasks
            levelOneT1 = new CollisionTask(rightHand, torchBbox1, "fire");
            levelOneT2 = new CollisionTask(rightHand, torchBbox2, "fire");
            levelTwoT1 = new CollisionTask(rightHand, fountainBbox, "water");

            //level one tasks
            levelOne.addTask(levelOneT1);
            levelOne.addTask(levelOneT2);

            //level two tasks
            levelTwo.addTask(levelTwoT1);

            myEffect = Content.Load<ParticleEffect>("handflame");
            myEffect.LoadContent(Content);
            myEffect.Initialise();

            waterEffect = Content.Load<ParticleEffect>("WaterJet");
            waterEffect.LoadContent(Content);
            waterEffect.Initialise();

            smokeEffect = Content.Load<ParticleEffect>("BasicSmokePlume");
            smokeEffect.LoadContent(Content);
            smokeEffect.Initialise();
            myRenderer.LoadContent(Content);

            //Load the sound file using Content.Load
            roomTone = Content.Load<SoundEffect>("kinectFinal--soundScape");
            fireSound = Content.Load<SoundEffect>("fx_fire_embers_01_a_lp");
            waterSound = Content.Load<SoundEffect>("amb_water_river_lp");
            instance1 = roomTone.CreateInstance();
            fireInstance = fireSound.CreateInstance();
            waterInstance = waterSound.CreateInstance();

            instance1.IsLooped = true;
            waterInstance.IsLooped = true;
            fireInstance.IsLooped = true;

            instance1.Play();
        }
开发者ID:rylancates,项目名称:DungeonGameTest-final,代码行数:70,代码来源:Game1.cs


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