Example #1
0
    /*--------------------------------------------------------------------------------*/

    public MeshMapping(IndicatorGrid _indicatorGrid)
    {
        indicatorGrid = _indicatorGrid;
        cursor        = Character2D.mappings[(int)Character2D.Mood.NEUTRAL];

        triangleMesh = new TriangleMesh2D(Character2D.map, Character2D.mappings);
        bounding     = new Bounding2D(
            Character2D.mappings[(int)Character2D.Mood.SAD],
            Character2D.mappings[(int)Character2D.Mood.RELAXED],
            Character2D.mappings[(int)Character2D.Mood.EXCITED],
            Character2D.mappings[(int)Character2D.Mood.IRRITATED]
            );

        cursor = bounding.Clip(cursor);
        indicatorGrid.SetCursor(bounding.GetMappedCoordinates(-1.0f, 1.0f));
    }
Example #2
0
        private static List<Bounding2D> ReadBounding2D(String LevelName)
        {
            List<Bounding2D> Bounding2DList = new List<Bounding2D>();

            FileStream levelBounding2DFS = new FileStream("Content/" + GameAssetsPath.LEVELS_PATH + LevelName + "/Bounding2D.list", FileMode.Open, FileAccess.Read);
            StreamReader levelBounding2DSR = new StreamReader(levelBounding2DFS);

            String str;
            while ((str = levelBounding2DSR.ReadLine()) != null)
            {
                if (str[0] == '#')
                {
                    continue;
                }

                String[] strElems = str.Split(";".ToCharArray());
                Int32 type = Int32.Parse(strElems[0]);
                Int32 par1 = 0;
                Int32 par2 = 0;
                Int32 par3 = 0;
                Int32 par4 = 0;
                if (type == 0 || type == 1)
                {
                    par1 = Int32.Parse(strElems[1]);
                    par2 = Int32.Parse(strElems[2]);
                    par3 = Int32.Parse(strElems[3]);
                }
                if (type == 1)
                {
                    par4 = Int32.Parse(strElems[4]);
                }

                //MessageBox.Show(type + " " + par1 + " " + par2 + " " + par3 + " " + par4);

                Bounding2D bound2D = new Bounding2D(type, par1, par2, par3, par4);
                Bounding2DList.Add(bound2D);
            }

            return Bounding2DList;
        }