コード例 #1
0
        public static Color RandomColor()
        {
            Color randomColor = new Color(
                RandomGen.GetFloat(0, 1),
                RandomGen.GetFloat(0, 1),
                RandomGen.GetFloat(0, 1)
                );

            return(randomColor);
        }
コード例 #2
0
ファイル: DNA.cs プロジェクト: samuellapointe/TiledLife
        public DNA()
        {
            physicalAttributes = new Dictionary <PhysicalAttribute, float>();

            // Thirst attributes
            physicalAttributes.Add(PhysicalAttribute.ThirstIncreaseRate, RandomGen.GetFloat(0.95f, 1f));
            physicalAttributes.Add(PhysicalAttribute.MaxThirst, RandomGen.GetInstance().Next(98, 103));
            physicalAttributes.Add(PhysicalAttribute.ThirstThreshold, RandomGen.GetFloat(0.01f, 0.03f)); //TODO set to something higher

            physicalAttributes.Add(PhysicalAttribute.ViewDistance, RandomGen.GetInstance().Next(50, 75));

            // Speed attributes
            physicalAttributes.Add(PhysicalAttribute.RotateSpeed, RandomGen.GetFloat(0.50f, 3.0f));
            physicalAttributes.Add(PhysicalAttribute.WalkSpeed, RandomGen.GetFloat(0.08f, 0.12f));
        }