예제 #1
0
        public static void checkSpecialCollisions(PlayerCharacter pc, EBossS1 boss, Rectangle fieldBounds)
        {
            // This is a pretty hackey way to do this and I'll re-write this system in a bit but I'm in a hurry now because it's 2AM on Monday.
            foreach (ExplodingBullet b in boss.getExplodingBullets())
            {
                Rectangle bulletRect = b.getRect();

                // If the bullet is exploded, check the shards.
                if (b.isExploded())
                {
                    foreach (Bullet bullet in b.getShards())
                    {
                        Rectangle shardRect = bullet.getRect();
                        if (shardRect.Intersects(pc.getRect()) && bullet.inPlay && pc.alive && !pc.respawning)
                        {
                            pc.Hit();
                            bullet.inPlay = false;
                        }
                    }
                }
                // Otherwise check the main bullet and not the shards.
                else
                {
                    if (bulletRect.Intersects(pc.getRect()) && b.inPlay && pc.alive && !pc.respawning)
                    {
                        pc.Hit();
                        b.inPlay = false;
                    }
                }
            }
        }
예제 #2
0
        public static void checkSpecialCollisions(PlayerCharacter pc, EBossS1 boss, Rectangle fieldBounds)
        {
            // This is a pretty hackey way to do this and I'll re-write this system in a bit but I'm in a hurry now because it's 2AM on Monday.
            foreach (ExplodingBullet b in boss.getExplodingBullets())
            {
                Rectangle bulletRect = b.getRect();

                // If the bullet is exploded, check the shards.
                if (b.isExploded())
                {
                    foreach (Bullet bullet in b.getShards())
                    {
                        Rectangle shardRect = bullet.getRect();
                        if (shardRect.Intersects(pc.getRect()) && bullet.inPlay && pc.alive && !pc.respawning)
                        {
                            pc.Hit();
                            bullet.inPlay = false;
                        }
                    }
                }
                // Otherwise check the main bullet and not the shards.
                else
                {
                    if (bulletRect.Intersects(pc.getRect()) && b.inPlay && pc.alive && !pc.respawning)
                    {
                        pc.Hit();
                        b.inPlay = false;
                    }
                }
            }
        }
예제 #3
0
 public override Enemy Copy(Vector2 position, Vector2 velocity, int mpattern, int fpattern, bool foodDrop, bool left)
 {
     Enemy enemyCopy = new EBossS1(
         new AnimatedTexture(aliveTex, 50, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 10),
         new AnimatedTexture(deadTex, 55, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 11),
         bulletText, maxBullets, scoreValue, 0.25f, position, velocity, mpattern, fpattern, foodDrop, left);
     return enemyCopy;
 }
예제 #4
0
        public override Enemy Copy(Vector2 position, Vector2 velocity, int mpattern, int fpattern, bool foodDrop, bool left)
        {
            Enemy enemyCopy = new EBossS1(
                new AnimatedTexture(aliveTex, 50, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 10),
                new AnimatedTexture(deadTex, 55, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 11),
                bulletText, maxBullets, scoreValue, 0.25f, position, velocity, mpattern, fpattern, foodDrop, left);

            return(enemyCopy);
        }
예제 #5
0
        public override Enemy CopyRight()
        {
            // Enemy copy method for right movement path
            Enemy enemyCopy = new EBossS1(
                new AnimatedTexture(aliveTex, 50, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 10),
                new AnimatedTexture(deadTex, 55, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 11),
                bulletText, maxBullets, scoreValue, 0.25f, new Vector2(350 - getWidth() / 2, -50f), new Vector2(0, 2.5f), 1, 1, false, false);

            return(enemyCopy);
        }
예제 #6
0
 // These copy methods are specific for each type of enemy.
 // They should be called on an enemy of a specific type (not the generic superclass).
 public override Enemy Copy()
 {
     // This returns an emeny with default settings. Good if you have a bunch of enemies
     // that don't really have different settings. Don't call this for the rock.
     Enemy enemyCopy = new EBossS1(
         new AnimatedTexture(aliveTex, 50, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 10),
         new AnimatedTexture(deadTex, 55, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 11),
         bulletText, maxBullets, scoreValue, 0.25f, new Vector2(300 - getWidth() / 2, -50f), new Vector2(0, 2f), 1, 1, false, false);
     return enemyCopy;
 }
예제 #7
0
        // These copy methods are specific for each type of enemy.
        // They should be called on an enemy of a specific type (not the generic superclass).

        public override Enemy Copy()
        {
            // This returns an emeny with default settings. Good if you have a bunch of enemies
            // that don't really have different settings. Don't call this for the rock.
            Enemy enemyCopy = new EBossS1(
                new AnimatedTexture(aliveTex, 50, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 10),
                new AnimatedTexture(deadTex, 55, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 11),
                bulletText, maxBullets, scoreValue, 0.25f, new Vector2(300 - getWidth() / 2, -50f), new Vector2(0, 2f), 1, 1, false, false);

            return(enemyCopy);
        }
예제 #8
0
 public override Enemy CopyRight()
 {
     // Enemy copy method for right movement path
     Enemy enemyCopy = new EBossS1(
         new AnimatedTexture(aliveTex, 50, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 10),
         new AnimatedTexture(deadTex, 55, 30, Vector2.Zero, 0.0f, 1.0f, 0.2f, 11),
         bulletText, maxBullets, scoreValue, 0.25f, new Vector2(350 - getWidth() / 2, -50f), new Vector2(0, 2.5f), 1, 1, false, false);
     return enemyCopy;
 }