File tree 1 file changed +9
-9
lines changed
1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 162
162
}
163
163
}
164
164
165
- day . ball . x = Ball . RADIUS + Math . ceil ( numSquaresX / 4 ) * Square . SIZE ;
166
- day . ball . y = Ball . RADIUS + Math . floor ( numSquaresY / 2 ) * Square . SIZE ;
167
- day . ball . dx = getRandomSign ( ) ;
168
- day . ball . dy = getRandomSign ( ) ;
169
-
170
- night . ball . x = Ball . RADIUS + Math . floor ( 3 * numSquaresX / 4 ) * Square . SIZE ;
171
- night . ball . y = Ball . RADIUS + Math . floor ( numSquaresY / 2 ) * Square . SIZE ;
172
- night . ball . dx = getRandomSign ( ) ;
173
- night . ball . dy = getRandomSign ( ) ;
165
+ day . ball . x = ( numSquaresX / 4 ) * Square . SIZE ;
166
+ day . ball . y = ( numSquaresY / 4 ) * Square . SIZE ;
167
+ day . ball . dx = 1 ;
168
+ day . ball . dy = 1 ;
169
+
170
+ night . ball . x = ( 3 * numSquaresX / 4 ) * Square . SIZE ;
171
+ night . ball . y = ( 3 * numSquaresX / 4 ) * Square . SIZE ;
172
+ night . ball . dx = - 1 ;
173
+ night . ball . dy = 1 ;
174
174
175
175
function calculateDistance ( p1 , p2 ) {
176
176
return Math . sqrt ( Math . pow ( p2 . x - p1 . x , 2 ) + Math . pow ( p2 . y - p1 . y , 2 ) )
You can’t perform that action at this time.
0 commit comments