@@ -226,18 +226,18 @@ public void fireBullet() {
226
226
}
227
227
228
228
protected void tickBullets (long paramLong ) {
229
- // try {
230
- for (int i = 0 ; i < this .m_vecFlyingBullets .size (); i ++) {
231
- Collidable localCollidable = this .m_vecFlyingBullets .elementAt (i );
232
- localCollidable .tick (paramLong , this );
233
- int j = localCollidable .getY () + localCollidable .getHeight ();
234
- if (j <= 0 ) {
235
- sendBulletToHell (localCollidable );
229
+ try {
230
+ for (int i = 0 ; i < this .m_vecFlyingBullets .size (); i ++) {
231
+ Collidable localCollidable = this .m_vecFlyingBullets .elementAt (i );
232
+ localCollidable .tick (paramLong , this );
233
+ int j = localCollidable .getY () + localCollidable .getHeight ();
234
+ if (j <= 0 ) {
235
+ sendBulletToHell (localCollidable );
236
+ }
236
237
}
238
+ } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException ) {
239
+ localArrayIndexOutOfBoundsException .printStackTrace ();
237
240
}
238
- // } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) {
239
- // localArrayIndexOutOfBoundsException.printStackTrace();
240
- // }
241
241
}
242
242
243
243
protected void paintMessage (Canvas canvas , Paint paint , String paramString1 , String paramString2 ) {
@@ -263,57 +263,57 @@ protected void paintMessage(Canvas canvas, Paint paint, String paramString1, Str
263
263
}
264
264
265
265
protected void paintFlyingBullets (Canvas canvas , Paint paint ) {
266
- // try {
267
- for (int i = 0 ; i < this .m_vecFlyingBullets .size (); i ++) {
268
- Collidable localCollidable = this .m_vecFlyingBullets .elementAt (i );
269
- localCollidable .paint (canvas , paint );
266
+ try {
267
+ for (int i = 0 ; i < this .m_vecFlyingBullets .size (); i ++) {
268
+ Collidable localCollidable = this .m_vecFlyingBullets .elementAt (i );
269
+ localCollidable .paint (canvas , paint );
270
+ }
271
+ } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException ) {
272
+ localArrayIndexOutOfBoundsException .printStackTrace ();
270
273
}
271
- // } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) {
272
- // localArrayIndexOutOfBoundsException.printStackTrace();
273
- // }
274
274
}
275
275
276
276
protected void hyperSpace () {
277
277
this .m_ship .setX (AstroSmashView .getAbsRandomInt () % (this .m_nScreenWidth - this .m_ship .getWidth ()));
278
278
}
279
279
280
280
protected void tickEnemies (long paramLong ) {
281
- // try {
282
- for (int i = 0 ; i < this .m_vecFlyingEnemies .size (); i ++) {
283
- Enemy localEnemy2 = this .m_vecFlyingEnemies .elementAt (i );
284
- localEnemy2 .tick (paramLong , this );
285
- if ((localEnemy2 .getY () + localEnemy2 .getHeight () >= this .m_groundHeight ) || (localEnemy2 .getX () + localEnemy2 .getWidth () >= this .m_nScreenWidth ) || (localEnemy2 .getY () < 0 ) || (localEnemy2 .getX () < 0 )) {
286
- if ((localEnemy2 .getY () + localEnemy2 .getHeight () >= this .m_groundHeight ) || (localEnemy2 .getY () < 0 )) {
287
- updateScore (localEnemy2 .getGroundScore ());
288
- }
289
- this .m_EnemiesToRecycleStack .push (localEnemy2 );
290
- if ((localEnemy2 .getEnemyTypeId () == 8 ) || (localEnemy2 .getEnemyTypeId () == 9 )) {
291
- this .m_ship .setCollided (true );
292
- shipDestroyed ();
293
- updateScore (-100 );
294
- break ;
295
- }
296
- } else {
297
- if (this .m_ship .intersects (localEnemy2 )) {
298
- shipDestroyed ();
299
- updateScore (-100 );
300
- break ;
301
- }
302
- for (int k = 0 ; k < this .m_vecFlyingBullets .size (); k ++) {
303
- Collidable localCollidable = this .m_vecFlyingBullets .elementAt (k );
304
- if (localCollidable .intersects (localEnemy2 , 1 , 2 )) {
305
- AstroSmashLauncher .doVibrate (AstroSmashLauncher .VIBRATE_SHORT );
306
- AstroSmashLauncher .playSound (AstroSmashLauncher .SOUND_HIT );
307
- updateScore (localEnemy2 .getHitScore ());
308
- sendBulletToHell (localCollidable );
281
+ try {
282
+ for (int i = 0 ; i < this .m_vecFlyingEnemies .size (); i ++) {
283
+ Enemy localEnemy2 = this .m_vecFlyingEnemies .elementAt (i );
284
+ localEnemy2 .tick (paramLong , this );
285
+ if ((localEnemy2 .getY () + localEnemy2 .getHeight () >= this .m_groundHeight ) || (localEnemy2 .getX () + localEnemy2 .getWidth () >= this .m_nScreenWidth ) || (localEnemy2 .getY () < 0 ) || (localEnemy2 .getX () < 0 )) {
286
+ if ((localEnemy2 .getY () + localEnemy2 .getHeight () >= this .m_groundHeight ) || (localEnemy2 .getY () < 0 )) {
287
+ updateScore (localEnemy2 .getGroundScore ());
288
+ }
289
+ this .m_EnemiesToRecycleStack .push (localEnemy2 );
290
+ if ((localEnemy2 .getEnemyTypeId () == 8 ) || (localEnemy2 .getEnemyTypeId () == 9 )) {
291
+ this .m_ship .setCollided (true );
292
+ shipDestroyed ();
293
+ updateScore (-100 );
309
294
break ;
310
295
}
296
+ } else {
297
+ if (this .m_ship .intersects (localEnemy2 )) {
298
+ shipDestroyed ();
299
+ updateScore (-100 );
300
+ break ;
301
+ }
302
+ for (int k = 0 ; k < this .m_vecFlyingBullets .size (); k ++) {
303
+ Collidable localCollidable = this .m_vecFlyingBullets .elementAt (k );
304
+ if (localCollidable .intersects (localEnemy2 , 1 , 2 )) {
305
+ AstroSmashLauncher .doVibrate (AstroSmashLauncher .VIBRATE_SHORT );
306
+ AstroSmashLauncher .playSound (AstroSmashLauncher .SOUND_HIT );
307
+ updateScore (localEnemy2 .getHitScore ());
308
+ sendBulletToHell (localCollidable );
309
+ break ;
310
+ }
311
+ }
311
312
}
312
313
}
314
+ } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException ) {
315
+ localArrayIndexOutOfBoundsException .printStackTrace ();
313
316
}
314
- // } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) {
315
- // localArrayIndexOutOfBoundsException.printStackTrace();
316
- // }
317
317
sendWaitingEnemiesToFactory ();
318
318
if (!this .m_bSuspendEnemies ) {
319
319
if (this .m_vecFlyingEnemies .size () < MAX_NUM_ENEMIES [this .m_nLevel ]) {
@@ -378,14 +378,14 @@ protected void sendDeadEnemyToHell(Enemy paramEnemy) {
378
378
}
379
379
380
380
protected void paintEnemies (Canvas canvas , Paint paint ) {
381
- // try {
382
- for (int i = 0 ; i < this .m_vecFlyingEnemies .size (); i ++) {
383
- Enemy localEnemy = this .m_vecFlyingEnemies .elementAt (i );
384
- localEnemy .paint (canvas , paint );
381
+ try {
382
+ for (int i = 0 ; i < this .m_vecFlyingEnemies .size (); i ++) {
383
+ Enemy localEnemy = this .m_vecFlyingEnemies .elementAt (i );
384
+ localEnemy .paint (canvas , paint );
385
+ }
386
+ } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException ) {
387
+ localArrayIndexOutOfBoundsException .printStackTrace ();
385
388
}
386
- // } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException) {
387
- // localArrayIndexOutOfBoundsException.printStackTrace();
388
- // }
389
389
}
390
390
391
391
protected void sendBulletToHell (Collidable paramCollidable ) {
@@ -396,23 +396,23 @@ protected void sendBulletToHell(Collidable paramCollidable) {
396
396
protected void shipDestroyed () {
397
397
AstroSmashLauncher .doVibrate (AstroSmashLauncher .VIBRATE_LONG );
398
398
AstroSmashLauncher .playSound (AstroSmashLauncher .SOUND_SHIP );
399
- // try {
400
- for (int i = 0 ; i < this .m_vecFlyingEnemies .size (); i ++) {
401
- Enemy enemy = this .m_vecFlyingEnemies .elementAt (i );
402
- this .m_EnemiesToRecycleStack .push (enemy );
399
+ try {
400
+ for (int i = 0 ; i < this .m_vecFlyingEnemies .size (); i ++) {
401
+ Enemy enemy = this .m_vecFlyingEnemies .elementAt (i );
402
+ this .m_EnemiesToRecycleStack .push (enemy );
403
+ }
404
+ } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException1 ) {
405
+ localArrayIndexOutOfBoundsException1 .printStackTrace ();
403
406
}
404
- // } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException1) {
405
- // localArrayIndexOutOfBoundsException1.printStackTrace();
406
- // }
407
407
sendWaitingEnemiesToFactory ();
408
- // try {
409
- for (int j = 0 ; j < this .m_vecFlyingBullets .size (); j ++) {
410
- Collidable collidable = this .m_vecFlyingBullets .elementAt (j );
411
- this .m_BulletsToRecycleStack .push (collidable );
408
+ try {
409
+ for (int j = 0 ; j < this .m_vecFlyingBullets .size (); j ++) {
410
+ Collidable collidable = this .m_vecFlyingBullets .elementAt (j );
411
+ this .m_BulletsToRecycleStack .push (collidable );
412
+ }
413
+ } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException2 ) {
414
+ localArrayIndexOutOfBoundsException2 .printStackTrace ();
412
415
}
413
- // } catch (ArrayIndexOutOfBoundsException localArrayIndexOutOfBoundsException2) {
414
- // localArrayIndexOutOfBoundsException2.printStackTrace();
415
- // }
416
416
this .m_vecFlyingBullets .removeAllElements ();
417
417
while (!this .m_BulletsToRecycleStack .empty ()) {
418
418
Collidable localCollidable = this .m_BulletsToRecycleStack .pop ();
0 commit comments