示例#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;
        }
示例#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);
        }
示例#3
0
        public bool IsCollided(Player player, Enemy enemy)
        {
            var intersectionDeter = new IntersectionDeterminant();

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

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

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

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

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

            if (intersectionDeter.IsIntersected(player.Form, obstacle.Form))
            {
                return true;
            }
            return false;
        }
示例#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);
        }
示例#10
0
        public bool IsCollided(Player player, Note note)
        {
            var intersectionDeter = new IntersectionDeterminant();

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

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

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

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

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

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