Example #1
0
        public bool IsCollided(Shot shot, Room room)
        {
            var intersectionDeter = new IntersectionDeterminant();
            var border = room.Border;
            if (intersectionDeter.IsIntersected(shot.Form,
                new RectangleF(room.Form.Left, room.Form.Top, border.Width, room.Form.Height)))
            {
                return true;
            }

            if (intersectionDeter.IsIntersected(shot.Form,
                new RectangleF(room.Form.Left, room.Form.Top, room.Form.Width, -border.Height)))
            {
                return true;
            }

            if (intersectionDeter.IsIntersected(shot.Form,
                new RectangleF(room.Form.Right - border.Width, room.Form.Top, border.Width, room.Form.Height)))
            {
                return true;
            }

            if (intersectionDeter.IsIntersected(shot.Form,
                new RectangleF(room.Form.Left, room.Form.Bottom + border.Height, room.Form.Width, -border.Height)))
            {
                return true;
            }

            return false;
        }
Example #2
0
        public bool IsCollided(Shot shot, Room room)
        {
            var intersectionDeter = new IntersectionDeterminant();
            var border            = room.Border;

            if (intersectionDeter.IsIntersected(shot.Form,
                                                new RectangleF(room.Form.Left, room.Form.Top, border.Width, room.Form.Height)))
            {
                return(true);
            }

            if (intersectionDeter.IsIntersected(shot.Form,
                                                new RectangleF(room.Form.Left, room.Form.Top, room.Form.Width, -border.Height)))
            {
                return(true);
            }

            if (intersectionDeter.IsIntersected(shot.Form,
                                                new RectangleF(room.Form.Right - border.Width, room.Form.Top, border.Width, room.Form.Height)))
            {
                return(true);
            }

            if (intersectionDeter.IsIntersected(shot.Form,
                                                new RectangleF(room.Form.Left, room.Form.Bottom + border.Height, room.Form.Width, -border.Height)))
            {
                return(true);
            }

            return(false);
        }
Example #3
0
        public bool IsCollided(Player player, Enemy enemy)
        {
            var intersectionDeter = new IntersectionDeterminant();

            if (intersectionDeter.IsIntersected(player.Form, enemy.Form))
            {
                return(true);
            }
            return(false);
        }
Example #4
0
        public bool IsCollided(Player player, Obstacle obstacle)
        {
            var intersectionDeter = new IntersectionDeterminant();

            if (intersectionDeter.IsIntersected(player.Form, obstacle.Form))
            {
                return(true);
            }
            return(false);
        }
Example #5
0
        public bool IsCollided(Enemy enemy1, Enemy enemy2)
        {
            var intersectionDeter = new IntersectionDeterminant();

            if (intersectionDeter.IsIntersected(enemy1.Form, enemy2.Form))
            {
                return(true);
            }
            return(false);
        }
Example #6
0
        public bool IsCollided(Enemy enemy, Obstacle obstacle)
        {
            var intersectionDeter = new IntersectionDeterminant();

            if (intersectionDeter.IsIntersected(enemy.Form, obstacle.Form))
            {
                return(true);
            }
            return(false);
        }
Example #7
0
        public bool IsCollided(Player player, Enemy enemy)
        {
            var intersectionDeter = new IntersectionDeterminant();

            if (intersectionDeter.IsIntersected(player.Form, enemy.Form))
            {
                return true;
            }
            return false;
        }
Example #8
0
        public bool IsCollided(Player player, Obstacle obstacle)
        {
            var intersectionDeter = new IntersectionDeterminant();

            if (intersectionDeter.IsIntersected(player.Form, obstacle.Form))
            {
                return true;
            }
            return false;
        }
Example #9
0
        public bool IsCollided(Player player, Room room)
        {
            var intersectionDeter = new IntersectionDeterminant();
            var border            = room.Border;
            var doors             = room.GetAllDoors();

            foreach (var t in doors)
            {
                if (IsCollided(player, t) && !t.IsLocked)
                {
                    return(false);
                }
            }

            if (intersectionDeter.IsIntersected(player.Form,
                                                new RectangleF(room.Form.Left, room.Form.Top, border.Width, room.Form.Height)))
            {
                return(true);
            }

            if (intersectionDeter.IsIntersected(player.Form,
                                                new RectangleF(room.Form.Left, room.Form.Top, room.Form.Width, -border.Height)))
            {
                return(true);
            }

            if (intersectionDeter.IsIntersected(player.Form,
                                                new RectangleF(room.Form.Right - border.Width, room.Form.Top, border.Width, room.Form.Height)))
            {
                return(true);
            }

            if (intersectionDeter.IsIntersected(player.Form,
                                                new RectangleF(room.Form.Left, room.Form.Bottom + border.Height, room.Form.Width, -border.Height)))
            {
                return(true);
            }

            return(false);
        }
Example #10
0
        public bool IsCollided(Player player, Note note)
        {
            var intersectionDeter = new IntersectionDeterminant();

            return(intersectionDeter.IsIntersected(player.Form, note.Form));
        }
Example #11
0
        public bool IsCollided(Player player, Lever lever)
        {
            var intersectionDeter = new IntersectionDeterminant();

            return(intersectionDeter.IsIntersected(player.Form, lever.Form));
        }
Example #12
0
 public bool IsCollided(Player player, FinishZone finishZone)
 {
     var intersectionDeter = new IntersectionDeterminant();
     return intersectionDeter.IsIntersected(player.Form, finishZone.Form);
 }
Example #13
0
        public bool IsCollided(Player player, FinishZone finishZone)
        {
            var intersectionDeter = new IntersectionDeterminant();

            return(intersectionDeter.IsIntersected(player.Form, finishZone.Form));
        }
Example #14
0
        public bool IsCollided(Shot shot, Enemy enemy)
        {
            var intersectionDeter = new IntersectionDeterminant();

            return(intersectionDeter.IsIntersected(shot.Form, enemy.Form));
        }
Example #15
0
        public bool IsCollided(Shot shot, Player player)
        {
            var intersectionDeter = new IntersectionDeterminant();

            return(intersectionDeter.IsIntersected(shot.Form, player.Form));
        }
Example #16
0
 public bool IsCollided(Shot shot, Player player)
 {
     var intersectionDeter = new IntersectionDeterminant();
     return intersectionDeter.IsIntersected(shot.Form, player.Form);
 }
Example #17
0
        public bool IsCollided(Player player, Item item)
        {
            var intersectionDeter = new IntersectionDeterminant();

            return(intersectionDeter.IsIntersected(player.Form, item.Form));
        }
Example #18
0
 public bool IsCollided(Shot shot, Enemy enemy)
 {
     var intersectionDeter = new IntersectionDeterminant();
     return intersectionDeter.IsIntersected(shot.Form, enemy.Form);
 }