示例#1
0
        public SwitchElectricity(Vector2 p)
            : base("Backgrounds/Switch/electricity", p)
        {
            on       = false;
            timer    = 0;
            endTimer = 5;

            //Set up beamOn
            beamOn = new bool[12];
            for (int i = 0; i < 12; i++)
            {
                beamOn[i] = false;
            }

            //Set up startpos
            startPos     = new Vector2[12];
            startPos[0]  = new Vector2(80, 64);
            startPos[1]  = new Vector2(96, 304);
            startPos[2]  = new Vector2(256, 176);
            startPos[3]  = new Vector2(192, 384);
            startPos[4]  = new Vector2(544, 96);
            startPos[5]  = new Vector2(672, 128);
            startPos[6]  = new Vector2(704, 256);
            startPos[7]  = new Vector2(224, 576);
            startPos[8]  = new Vector2(416, 608);
            startPos[9]  = new Vector2(624, 544);
            startPos[10] = new Vector2(496, 704);
            startPos[11] = new Vector2(736, 720);

            //Set up sprites
            beams     = new Impathable[12];
            beams[0]  = new Impathable("Backgrounds/Switch/elect1", startPos[0], Vector2.Zero);
            beams[1]  = new Impathable("Backgrounds/Switch/elect2", startPos[1], Vector2.Zero);
            beams[2]  = new Impathable("Backgrounds/Switch/elect3", startPos[2], Vector2.Zero);
            beams[3]  = new Impathable("Backgrounds/Switch/elect4", startPos[3], Vector2.Zero);
            beams[4]  = new Impathable("Backgrounds/Switch/elect5", startPos[4], Vector2.Zero);
            beams[5]  = new Impathable("Backgrounds/Switch/elect6", startPos[5], Vector2.Zero);
            beams[6]  = new Impathable("Backgrounds/Switch/elect7", startPos[6], Vector2.Zero);
            beams[7]  = new Impathable("Backgrounds/Switch/elect8", startPos[7], Vector2.Zero);
            beams[8]  = new Impathable("Backgrounds/Switch/elect9", startPos[8], Vector2.Zero);
            beams[9]  = new Impathable("Backgrounds/Switch/elect10", startPos[9], Vector2.Zero);
            beams[10] = new Impathable("Backgrounds/Switch/elect11", startPos[10], Vector2.Zero);
            beams[11] = new Impathable("Backgrounds/Switch/elect12", startPos[11], Vector2.Zero);
        }
示例#2
0
        public void Update()
        {
            //Goes through all the objects
            for (int i = 0; i < topObjects.Count; i++)
            {
                //Store the item in case it dies
                Environment e = topObjects[i];

                //Lets it update
                e.Update(managers);

                //If it no longer exists, re-sync the loop
                if (!topObjects.Contains(e))
                {
                    i--;
                }
            }

            //Goes through all the objects
            for (int i = 0; i < botObjects.Count; i++)
            {
                //Store the item in case it dies
                Environment e = botObjects[i];

                //Lets it update
                e.Update(managers);

                //If it no longer exists, re-sync the loop
                if (!botObjects.Contains(e))
                {
                    i--;
                }
            }

            for (int i = 0; i < staticBlockers.Count; i++)
            {
                //Store the item in case it dies
                Environment e = staticBlockers[i];

                //Lets it update
                e.Update(managers);

                //If it no longer exists, re-sync the loop
                if (!staticBlockers.Contains(e))
                {
                    i--;
                }
            }

            for (int i = 0; i < notPassables.Count; i++)
            {
                //Store the item in case it dies
                Impassable e = notPassables[i];

                //Lets it update
                e.Update(managers);

                //If it no longer exists, re-sync the loop
                if (!notPassables.Contains(e))
                {
                    i--;
                }
            }

            for (int i = 0; i < notPathables.Count; i++)
            {
                //Store the item in case it dies
                Impathable e = notPathables[i];

                //Lets it update
                e.Update(managers);

                //If it no longer exists, re-sync the loop
                if (!notPathables.Contains(e))
                {
                    i--;
                }
            }
        }
示例#3
0
 public void RemoveImpathable(Impathable i)
 {
     notPathables.Remove(i);
 }
示例#4
0
 public void AddImpathable(Impathable i)
 {
     notPathables.Add(i);
     i.LoadContent(managers.GetTextureManager());
 }