コード例 #1
0
        public void AddEnvironment(string name, Vector2f size, Vector2f position)
        {
            PEntity entity = new PEnvironment(name, this);

            entity.Position = position;
            entity.Size     = size;
            entity.GenerateHitmesh();
        }
コード例 #2
0
ファイル: GameRoom.cs プロジェクト: Akster009/thesisrpg
        public void GenerateWalls()
        {
            Random rand    = new Random();
            int    wallNum = rand.Next(0, (int)(Size.X * Size.X * 0.0256));

            for (int i = 0; i < wallNum; i++)
            {
                PEnvironment wall = new PEnvironment("Wall", Game);
                wall.Size = new Vector2f(64, 64);
                wall.GenerateHitmesh();
                wall.Position = new Vector2f(rand.Next(200, Size.X * 32 - 200), rand.Next(200, Size.Y * 32 - 200));
                if (!TooClose(wall.Position, 200))
                {
                    Environment.Add(wall);
                }
            }
        }