Пример #1
0
        public void CollisionDetectionZomRandom(ZombieRandom zomRandom, int viewportWidth, int viewportHeight, Rectangle bulletRectangle)
        {
            if (bulletRectangle.Intersects(zomRandom.zomRandomRectangle) && bulletAlive == true)
            {
                zomRandom.zomRandomHit = true;
                zomRandom.Respawn(random, viewportWidth, viewportHeight);
                bulletAlive = false;

                score = score + 1;
            }
        }
Пример #2
0
        public void CollisionDetectionZomRandom(ZombieRandom zomRandom, int viewportWidth, int viewportHeight, Bullet bullet)
        {
            Rectangle playerRectangle =
                new Rectangle((int)playerPosition.X, (int)playerPosition.Y,
                              mSpriteTexture.Width, mSpriteTexture.Height);

            if (playerRectangle.Intersects(zomRandom.zomRandomRectangle))
            {
                zomRandom.zomRandomHit = true;

                zomRandom.Respawn(random, viewportWidth, viewportHeight);
                playerAlive = false;
                Respawn(viewportWidth, viewportHeight);
                playerHit = true;


                bullet.score = 0;
            }
        }