Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seed should not be global #10

Open
totty90 opened this issue Nov 3, 2014 · 3 comments
Open

seed should not be global #10

totty90 opened this issue Nov 3, 2014 · 3 comments

Comments

@totty90
Copy link

totty90 commented Nov 3, 2014

you should instance a Noise and set the seed on that one.

@Hypercubed
Copy link

I agree with this... the module should really return a constructor so the seed can be set once per instance. Something like:

var myNoise = Noise(seed);
var z = myNoise.perlin2(x,y);

@BenMcLean
Copy link

Yeah, making this global is pretty ridiculous. There is no reason it should be global.

@370417
Copy link

370417 commented Sep 29, 2016

I tried to do this: #19
This is my first time doing anything like this, so I'm not sure if I'm going about it in the right way, but I replaced the anonymous function with a named one and gave it the seed as a parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants