home *** CD-ROM | disk | FTP | other *** search
- import com.next.gt.Actor;
- import com.next.gt.Gamelication;
- import java.awt.Image;
- import java.awt.MediaTracker;
-
- public class Bigoobie extends Actor {
- public int attackResistance = 3;
-
- Bigoobie(Boinkaroids var1) {
- super.owner = var1;
- Image var2 = super.owner.getImage(super.owner.getCodeBase(), "images/bigoobie.gif");
- MediaTracker var3 = new MediaTracker(var1);
- var3.addImage(var2, 0);
-
- try {
- var3.waitForID(0);
- } catch (InterruptedException var4) {
- }
-
- super.x = Math.random() * (double)512.0F;
- super.y = Math.random() * (double)512.0F;
- super.velocity_x = (double)((int)Gamelication.randBetween((double)0.5F, (double)1.5F) * 2 - 1) * Gamelication.randBetween((double)16.0F, (double)48.0F);
- super.velocity_y = (double)((int)Gamelication.randBetween((double)0.5F, (double)1.5F) * 2 - 1) * Gamelication.randBetween((double)16.0F, (double)48.0F);
- ((Actor)this).setImage(var2, 4, 12);
- super.currentFrame = (int)Gamelication.randBetween((double)0.0F, (double)super.numFrames);
- }
-
- public void explode() {
- for(int var1 = 0; var1 < 2; ++var1) {
- super.owner.actorManager.addActor(new Goobie(super.owner, this));
- ((Boinkaroids)super.owner).addOneBadGuy();
- }
-
- super.owner.play(super.owner.getCodeBase(), "sounds/pop.au");
- super.owner.scoreManager.addToScore(500);
- super.owner.actorManager.removeActor(this);
- ((Boinkaroids)super.owner).removeOneBadGuy();
- }
-
- protected void collideWithActor(Actor var1) {
- String var2 = var1.getClass().getName();
- if (var2.equals("Bullet") || var2.equals("Ship")) {
- if (--this.attackResistance < 0) {
- this.explode();
- return;
- }
-
- super.owner.play(super.owner.getCodeBase(), "sounds/futility.au");
- }
-
- }
- }
-