File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -140,15 +140,15 @@ <h3>4. Time integration</h3>
140
140
this . timeStepSize = 0.05 ;
141
141
this . time = 0 ;
142
142
this . maxLifeTime = 3 ;
143
- this . bodyEmission = 5 ;
143
+ this . rbEmission = 5 ;
144
144
this . emitter_x = 0.0 ;
145
145
this . emitter_y = 0.0 ;
146
146
}
147
147
148
148
emitRigidBodies ( )
149
149
{
150
150
// emit new rigid bodies
151
- for ( let i = 0 ; i < this . bodyEmission ; i ++ )
151
+ for ( let i = 0 ; i < this . rbEmission ; i ++ )
152
152
{
153
153
// use random variation of velocity
154
154
let vx = - 5 + Math . random ( ) * 10.0 ;
@@ -287,8 +287,9 @@ <h3>4. Time integration</h3>
287
287
288
288
this . c . save ( ) ;
289
289
this . c . beginPath ( ) ;
290
- this . c . translate ( px - s2 , py - s2 ) ;
290
+ this . c . translate ( px , py ) ;
291
291
this . c . rotate ( rb . rotation ) ;
292
+ this . c . translate ( - s2 , - s2 ) ;
292
293
this . c . rect ( 0 , 0 , s , s ) ;
293
294
this . c . closePath ( ) ;
294
295
this . c . fill ( ) ;
You can’t perform that action at this time.
0 commit comments