File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,23 @@ Sometimes you want to squeeze in a new scene between two other scenes that you a
145
145
Often you will perhaps only shorten the preceding scene and leave the start of the following scene intact.
146
146
But for completeness, here is an example where we both shorten the previous scene, and chop down the beginning of the following scene.
147
147
148
+ ### Randomness
149
+
150
+ To ensure that random things happen consistently across runs it is recommended to use the ` Random ` -class rather than ` Math.random() ` .
151
+ Set up ` Random ` by initializing it in your constructor like so:
152
+ ```
153
+ constructor(id, options) {
154
+ ...
155
+ this.random = new Random('seedString');
156
+ ...
157
+ }
158
+ ```
159
+
160
+ Then use the random generator you just created like this:
161
+ ```
162
+ var randomNumber = this.random();
163
+ ```
164
+
148
165
### Time and timed events
149
166
150
167
A lot of making a demo is syncing what's happening on the screen with the music.
You can’t perform that action at this time.
0 commit comments