Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public CollisionTask(Bbox b1, Bbox b2, string el)
 {
     bbox1 = b1;
     bbox2 = b2;
     element = el;
 }
Esempio n. 3
0
        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();
        }