Re:Show HN: Terra, a JS framework for cellular automata and ...
by ttty on Saturday August 23, 2014 @07:07PM
(#8217134)
Ok (: I'm still figuring out the mechanics.
The only thing I don't really like is the way it works. Is global... :/
[ Parent
| on HN ]
Re:Show HN: Terra, a JS framework for cellular automata and ...
by rileyjshaw on Saturday August 23, 2014 @07:21PM
(#8217160)
It doesn't have to be global! Terra works as a module with most popular module systems. For example:
var terra = require('./terra.min.js');
should work in any CommonJS environment.
Re:Show HN: Terra, a JS framework for cellular automata and ...
by ttty on Saturday August 23, 2014 @07:36PM
(#8217186)
I mean when you register
terra.creatureFactory.register({type: 'firstCreature'});
this is stored in the global `terra` variable... Would be better IMO var terra = new Terra();terra.creatureFactory.register({type: 'firstCreature'});
Re:Show HN: Terra, a JS framework for cellular automata and ...
by rileyjshaw on Saturday August 23, 2014 @07:40PM
(#8217191)
I understand what you mean now. Are you able to make a pull request (or an issue) at https://github.com/rileyjshaw/terra? Pretty busy for the next few days but I'll try to get to it
Re:Show HN: Terra, a JS framework for cellular automata and ...
by rileyjshaw on Monday August 25, 2014 @01:41PM
(#8222871)
Actually, I've been thinking more about this and feel it's better to define creatures on the root terra object. Running the same simulation 100 times with slightly different starting conditions, for example, would require a new terrarium for each trial but creatures should be shared between..