Ejemplo n.º 1
0
        private void OnTransitionInBegin()
        {
            Level level = SceneAs <Level>();

            if (MasterOfGroup)
            {
                Player player = null;
                foreach (CaveWall entity in Group)
                {
                    if (level.PreviousBounds.HasValue && Collide.CheckRect(entity, level.PreviousBounds.Value))
                    {
                        entity.transitionFade = true;
                        entity.tiles.Alpha    = 0f;
                    }
                    else
                    {
                        entity.transitionFade = false;
                    }
                    player = entity.CollideFirst <Player>();
                    if (player != null)
                    {
                        break;
                    }
                }

                if (player != null)
                {
                    foreach (CaveWall entity in Group)
                    {
                        entity.transitionFade = false;
                        entity.tiles.Alpha    = 0f;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void OnTransitionOutBegin()
 {
     if (Collide.CheckRect(this, SceneAs <Level>().Bounds))
     {
         transitionFade       = true;
         transitionStartAlpha = tiles.Alpha;
     }
     else
     {
         transitionFade = false;
     }
 }
Ejemplo n.º 3
0
        private void OnTransitionInBegin()
        {
            Level level = SceneAs <Level>();

            if (level.PreviousBounds.HasValue && Collide.CheckRect(this, level.PreviousBounds.Value))
            {
                transitionFade = true;
                tiles.Alpha    = 0f;
            }
            else
            {
                transitionFade = false;
            }
        }
Ejemplo n.º 4
0
 public bool CollideRect(Rectangle rect, Vector2 at)
 {
     return(Collide.CheckRect(this, rect, at));
 }