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>
140140 this . timeStepSize = 0.05 ;
141141 this . time = 0 ;
142142 this . maxLifeTime = 3 ;
143- this . bodyEmission = 5 ;
143+ this . rbEmission = 5 ;
144144 this . emitter_x = 0.0 ;
145145 this . emitter_y = 0.0 ;
146146 }
147147
148148 emitRigidBodies ( )
149149 {
150150 // emit new rigid bodies
151- for ( let i = 0 ; i < this . bodyEmission ; i ++ )
151+ for ( let i = 0 ; i < this . rbEmission ; i ++ )
152152 {
153153 // use random variation of velocity
154154 let vx = - 5 + Math . random ( ) * 10.0 ;
@@ -287,8 +287,9 @@ <h3>4. Time integration</h3>
287287
288288 this . c . save ( ) ;
289289 this . c . beginPath ( ) ;
290- this . c . translate ( px - s2 , py - s2 ) ;
290+ this . c . translate ( px , py ) ;
291291 this . c . rotate ( rb . rotation ) ;
292+ this . c . translate ( - s2 , - s2 ) ;
292293 this . c . rect ( 0 , 0 , s , s ) ;
293294 this . c . closePath ( ) ;
294295 this . c . fill ( ) ;
You can’t perform that action at this time.
0 commit comments