Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
fix for RandomGenerator
  • Loading branch information
KilledByAPixel committed Apr 19, 2024
1 parent de0f9da commit 3e4cb9d
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions build/littlejs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -579,10 +579,10 @@ declare module "littlejs.esm" {
* - Can be used to create a deterministic random number sequence
* @example
* let r = new RandomGenerator(123); // random number generator with seed 123
* let a = r.rand(); // random value between 0 and 1
* let b = r.randInt(10); // random integer between 0 and 9
* let a = r.float(); // random value between 0 and 1
* let b = r.int(10); // random integer between 0 and 9
* r.seed = 123; // reset the seed
* let c = r.rand(); // the same value as a
* let c = r.float(); // the same value as a
*/
export class RandomGenerator {
/** Create a random number generator with the seed passed in
Expand Down Expand Up @@ -1007,7 +1007,7 @@ declare module "littlejs.esm" {
* @param {Number} [textureIndex=0] - Texture index to use
* @return {TileInfo}
* @example
* tile(2) // a tile at index 2 using the default tile size (16)
* tile(2) // a tile at index 2 using the default tile size of 16
* tile(5, 8) // a tile at index 5 using a tile size of 8
* tile(1, 16, 3) // a tile at index 1 of size 16 on texture 3
* tile(vec2(4,8), vec2(30,10)) // a tile at pixel location (4,8) with a size of (30,10)
Expand Down
12 changes: 6 additions & 6 deletions build/littlejs.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,10 +617,10 @@ function randColor(colorA=new Color, colorB=new Color(0,0,0,1), linear)
* - Can be used to create a deterministic random number sequence
* @example
* let r = new RandomGenerator(123); // random number generator with seed 123
* let a = r.rand(); // random value between 0 and 1
* let b = r.randInt(10); // random integer between 0 and 9
* let a = r.float(); // random value between 0 and 1
* let b = r.int(10); // random integer between 0 and 9
* r.seed = 123; // reset the seed
* let c = r.rand(); // the same value as a
* let c = r.float(); // the same value as a
*/
class RandomGenerator
{
Expand Down Expand Up @@ -649,11 +649,11 @@ class RandomGenerator
* @param {Number} valueA
* @param {Number} [valueB=0]
* @return {Number} */
int(valueA, valueB=0) { return Math.floor(this.rand(valueA, valueB)); }
int(valueA, valueB=0) { return Math.floor(this.float(valueA, valueB)); }

/** Randomly returns either -1 or 1 deterministically
* @return {Number} */
sign() { return this.randInt(2) * 2 - 1; }
sign() { return this.int(2) * 2 - 1; }
}

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1957,7 +1957,7 @@ let drawCount;
* @param {Number} [textureIndex=0] - Texture index to use
* @return {TileInfo}
* @example
* tile(2) // a tile at index 2 using the default tile size (16)
* tile(2) // a tile at index 2 using the default tile size of 16
* tile(5, 8) // a tile at index 5 using a tile size of 8
* tile(1, 16, 3) // a tile at index 1 of size 16 on texture 3
* tile(vec2(4,8), vec2(30,10)) // a tile at pixel location (4,8) with a size of (30,10)
Expand Down
2 changes: 1 addition & 1 deletion build/littlejs.esm.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions build/littlejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -617,10 +617,10 @@ function randColor(colorA=new Color, colorB=new Color(0,0,0,1), linear)
* - Can be used to create a deterministic random number sequence
* @example
* let r = new RandomGenerator(123); // random number generator with seed 123
* let a = r.rand(); // random value between 0 and 1
* let b = r.randInt(10); // random integer between 0 and 9
* let a = r.float(); // random value between 0 and 1
* let b = r.int(10); // random integer between 0 and 9
* r.seed = 123; // reset the seed
* let c = r.rand(); // the same value as a
* let c = r.float(); // the same value as a
*/
class RandomGenerator
{
Expand Down Expand Up @@ -649,11 +649,11 @@ class RandomGenerator
* @param {Number} valueA
* @param {Number} [valueB=0]
* @return {Number} */
int(valueA, valueB=0) { return Math.floor(this.rand(valueA, valueB)); }
int(valueA, valueB=0) { return Math.floor(this.float(valueA, valueB)); }

/** Randomly returns either -1 or 1 deterministically
* @return {Number} */
sign() { return this.randInt(2) * 2 - 1; }
sign() { return this.int(2) * 2 - 1; }
}

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1957,7 +1957,7 @@ let drawCount;
* @param {Number} [textureIndex=0] - Texture index to use
* @return {TileInfo}
* @example
* tile(2) // a tile at index 2 using the default tile size (16)
* tile(2) // a tile at index 2 using the default tile size of 16
* tile(5, 8) // a tile at index 5 using a tile size of 8
* tile(1, 16, 3) // a tile at index 1 of size 16 on texture 3
* tile(vec2(4,8), vec2(30,10)) // a tile at pixel location (4,8) with a size of (30,10)
Expand Down
2 changes: 1 addition & 1 deletion build/littlejs.min.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions build/littlejs.release.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ function randColor(colorA=new Color, colorB=new Color(0,0,0,1), linear)
* - Can be used to create a deterministic random number sequence
* @example
* let r = new RandomGenerator(123); // random number generator with seed 123
* let a = r.rand(); // random value between 0 and 1
* let b = r.randInt(10); // random integer between 0 and 9
* let a = r.float(); // random value between 0 and 1
* let b = r.int(10); // random integer between 0 and 9
* r.seed = 123; // reset the seed
* let c = r.rand(); // the same value as a
* let c = r.float(); // the same value as a
*/
class RandomGenerator
{
Expand Down Expand Up @@ -272,11 +272,11 @@ class RandomGenerator
* @param {Number} valueA
* @param {Number} [valueB=0]
* @return {Number} */
int(valueA, valueB=0) { return Math.floor(this.rand(valueA, valueB)); }
int(valueA, valueB=0) { return Math.floor(this.float(valueA, valueB)); }

/** Randomly returns either -1 or 1 deterministically
* @return {Number} */
sign() { return this.randInt(2) * 2 - 1; }
sign() { return this.int(2) * 2 - 1; }
}

///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1580,7 +1580,7 @@ let drawCount;
* @param {Number} [textureIndex=0] - Texture index to use
* @return {TileInfo}
* @example
* tile(2) // a tile at index 2 using the default tile size (16)
* tile(2) // a tile at index 2 using the default tile size of 16
* tile(5, 8) // a tile at index 5 using a tile size of 8
* tile(1, 16, 3) // a tile at index 1 of size 16 on texture 3
* tile(vec2(4,8), vec2(30,10)) // a tile at pixel location (4,8) with a size of (30,10)
Expand Down

0 comments on commit 3e4cb9d

Please sign in to comment.