Skip to content

A C# library full of useful tools for randomization in games built with the MonoGame framework

License

Notifications You must be signed in to change notification settings

MStadlmeier/RUL_MonoGame

Repository files navigation

RUL_MonoGame

Version 1.0.0
This library is designed to simplify randomization and the creation of procedurally generated content. RUL is capable of generating pseudo-random numbers, vectors, colors and noise, as well as randomly modifying existing objects.

Rul is split into four modules : Rul, RulVec (for vector randomization), RulCol (for color randomization) and RulNoise (for creating noise) . All these modules are implemented as static classes in the RUL namespace.

Other versions

This version of RUL uses MonoGame's vector and color types. A port for Unity, as well as a standalone version exist.

Setting up RUL

The easiest way to get started with RUL is to check out the tutorials in the wiki. They cover everything from downloading the source to generating Perlin noise.

Code samples :

using RUL;
...
long myLong = Rul.RandLong(700,1000); // Creates random long between 700 and 1000

long myInt = Rul.RandInt(5,10,InclusionOptions.Upper); //Returns random int between 6 and 10

string name = Rul.RandElement("Jon","Ned","Bran"); //Returns one of the given elements

int probablyOne = Rul.RandElement(new int[] {1,2,3},0.9F); //Returns 1 in nine out of ten cases

Vector3 unitVec = RulVec.RandUnitVector3(); //Returns a random 3D vector with length 1

Color lightColor = RulCol.RandColor(200); //Returns a light color

Color darkRed = RulCol.RandColor(Hues.Red, LuminosityTypes.Dark); //Returns a dark shade of red

float[,] noise = RulNoise.RandPerlinNoise2(400,400); //Returns perlin noise 

License

This library is published under the very permissive MIT license. See http://opensource.org/licenses/MIT for information on what you can and cannot do with this software.

About

A C# library full of useful tools for randomization in games built with the MonoGame framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages