Пример #1
0
Файл: Room.cs Проект: Milun/VWA
        public Vector2 CheckCol(Vector2 pos, Vector2 size)
        {
            ColSquare a = new ColSquare(pos, Vector2.One * -size / 2f, Vector2.One * size);

            a.DrawDebug(Editor.colorDebug3);

            foreach (Col e in cols)
            {
                Vector2 output = a.CheckCol(e);

                if (output != Vector2.Zero)
                {
                    return(output);
                }
            }


            foreach (KeyValuePair <IntVector2D, Actor> e in actors)
            {
                Vector2 output = e.Value.CheckCol(a);

                if (output != Vector2.Zero)
                {
                    return(-output);
                }
            }

            return(Vector2.Zero);
        }
Пример #2
0
Файл: Room.cs Проект: Milun/VWA
        public void MsgCol(Vector2 pos, Vector2 size, string msg)
        {
            Col a = new ColSquare(pos, Vector2.Zero, Vector2.One * size);

            a.DrawDebug(Color.Pink);

            foreach (KeyValuePair <IntVector2D, Actor> e in actors)
            {
                if (e.Value.CheckTrig(a) != Vector2.Zero)
                {
                    e.Value.PassMsg(msg);
                }
                else if (e.Value.CheckCol(a) != Vector2.Zero)
                {
                    e.Value.PassMsg(msg);
                }
            }
        }