home *** CD-ROM | disk | FTP | other *** search
- head 1.3;
- access;
- symbols;
- locks; strict;
- comment @# @;
-
-
- 1.3
- date 98.04.19.17.36.50; author mds1274; state Exp;
- branches;
- next 1.2;
-
- 1.2
- date 98.04.15.16.21.41; author mds1274; state Exp;
- branches;
- next 1.1;
-
- 1.1
- date 98.04.10.17.53.49; author jgh8962; state Exp;
- branches;
- next ;
-
-
- desc
- @@
-
-
- 1.3
- log
- @*** empty log message ***
- @
- text
- @/**
- *
- * Bigoobie.java
- * @@author Mark G. Tacchi (mtacchi@@next.com)
- * @@version 0.8
- * Mar 18/1996
- *
- * A Bigoobie transparent shell containing two orbiting goobies. They take
- * a number of hits and then pop.
- *
- * Bigoobies harm ships and bullets harm Bigoobies.
- *
- */
-
- import java.lang.Math;
- import com.next.gt.*;
-
- public class Bigoobie extends Actor {
- //
- // This actor has to be hit this many times before dying.
- //
- public int attackResistance= 3;
-
- Bigoobie(Boinkaroids theOwner) {
- super();
- java.awt.Image theImage;
- java.awt.MediaTracker tracker;
- owner= theOwner;
-
- theImage = owner.getImage(owner.getCodeBase(), "images/bigoobie.gif");
- tracker = new java.awt.MediaTracker(theOwner);
- tracker.addImage(theImage, 0);
-
- try{
- tracker.waitForID(0);
- }
- catch (InterruptedException e) {}
-
- x= (Math.random()*512);
- y= (Math.random()*512);
- velocity_x= (double)((int)Gamelication.randBetween(0.5,1.5)*2 - 1) * Gamelication.randBetween(16.,48.);
- velocity_y= (double)((int)Gamelication.randBetween(0.5,1.5)*2 - 1) * Gamelication.randBetween(16.,48.);
- setImage (theImage, 4, 12);
- currentFrame= (int)Gamelication.randBetween(0, numFrames);
-
- } /*Bigoobie()*/
-
-
- /**
- * Explode goobie.
- */
- public void explode()
- {
- //
- // free the 2 goobies
- //
- for (int i= 0; i<2; i++) {
- owner.actorManager.addActor(new Goobie(owner, this));
- ((Boinkaroids)owner).addOneBadGuy();
- } /*next_i*/
-
- //
- // play explode sound
- //
- owner.play(owner.getCodeBase(), "sounds/pop.au");
-
- //
- // give credit for hitting me, increase score
- //
- owner.scoreManager.addToScore(500);
-
- //
- // i'm dead, i should schedule to be removed
- //
- owner.actorManager.removeActor(this);
-
- //
- // tell the Gamelication that there is one less bad guy
- //
- ((Boinkaroids)owner).removeOneBadGuy();
- } /*explode*/
-
-
- /**
- * Handle collision with an actor.
- */
- protected void collideWithActor (Actor theActor){
- String theActorClassName= theActor.getClass().getName();
- if (theActorClassName.equals("Bullet") ||
- theActorClassName.equals("Ship") ) {
- if (--attackResistance<0) {
- explode();
- }
- else {
- owner.play(owner.getCodeBase(), "sounds/futility.au");
- }
- } /*endif*/
- } /*collideWithActor*/
-
- } /*Bigoobie*/
- @
-
-
- 1.2
- log
- @*** empty log message ***
- @
- text
- @d59 1
- a59 1
- ((Boinkaroids)owner).badGuyCount++;
- d80 1
- a80 1
- ((Boinkaroids)owner).badGuyCount--;
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @a14 1
- //import java.applet.Applet;
- a15 1
-
- d19 4
- a22 4
- //
- // This actor has to be hit this many times before dying.
- //
- public int attackResistance= 3;
- d25 4
- a28 1
- super();
- d30 5
- a34 10
- java.awt.Image theImage;
- java.awt.MediaTracker tracker;
-
- owner= theOwner;
-
- theImage = owner.getImage(owner.getCodeBase(), "images/bigoobie.gif");
- tracker = new java.awt.MediaTracker(theOwner);
-
- tracker.addImage(theImage, 0);
- try{
- d36 9
- a44 7
- }
- catch (InterruptedException e) {}
- x= (Math.random()*512);
- y= (Math.random()*512);
- velocity_x= (double)((int)Gamelication.randBetween(0.5,1.5)*2 - 1) * Gamelication.randBetween(16.,48.);
- velocity_y= (double)((int)Gamelication.randBetween(0.5,1.5)*2 - 1) * Gamelication.randBetween(16.,48.);
- setImage (theImage, 4, 12);
- a45 2
- currentFrame= (int)Gamelication.randBetween(0, numFrames);
-
- a48 1
-
- d54 7
- a60 7
- //
- // free the 2 goobies
- //
- for (int i= 0; i<2; i++) {
- owner.actorManager.addActor(new Goobie(owner, this));
- ((Boinkaroids)owner).badGuyCount++;
- } /*next_i*/
- d62 4
- a65 4
- //
- // play explode sound
- //
- owner.play(owner.getCodeBase(), "sounds/pop.au");
- d67 4
- a70 4
- //
- // give credit for hitting me, increase score
- //
- owner.scoreManager.addToScore(500);
- d72 4
- a75 4
- //
- // i'm dead, i should schedule to be removed
- //
- owner.actorManager.removeActor(this);
- d77 4
- a80 5
- //
- // tell the Gamelication that there is one less bad guy
- //
- ((Boinkaroids)owner).badGuyCount--;
-
- a83 2
-
-
- d87 11
- a97 14
- protected void collideWithActor (Actor theActor)
- {
- String theActorClassName= theActor.getClass().getName();
-
- if (theActorClassName.equals("Bullet") ||
- theActorClassName.equals("Ship") ) {
- if (--attackResistance<0) {
- explode();
- }
- else {
- owner.play(owner.getCodeBase(), "sounds/futility.au");
- }
- } /*endif*/
-
- @
-