home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / Gamelication / examples / Boink / RCS / Boink.java,v < prev    next >
Encoding:
Text File  |  1998-04-13  |  1.2 KB  |  76 lines

  1. head    1.1;
  2. access;
  3. symbols;
  4. locks
  5.     jgh8962:1.1; strict;
  6. comment    @# @;
  7.  
  8.  
  9. 1.1
  10. date    98.04.13.23.33.29;    author jgh8962;    state Exp;
  11. branches;
  12. next    ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19. 1.1
  20. log
  21. @Initial revision
  22. @
  23. text
  24. @/**
  25.  *
  26.  * Boink.java
  27.  * @@author    Mark G. Tacchi (mtacchi@@next.com) 
  28.  * @@version    1.0
  29.  * Feb 23/1996
  30.  *
  31.  * Create a bunch of bouncy balls.  Cool as ice, and easy as pie!
  32.  *
  33.  */
  34.  
  35. import java.awt.Color;
  36. import java.awt.Frame;
  37. import com.next.gt.*;
  38.  
  39. public class Boink extends Gamelication {
  40. public void init() {
  41.   super.init( 320,240 );
  42.   Frame f = new Frame( "Gamelication" );
  43.   f.setSize( 320, 240 );
  44.   f.add( this );
  45.   f.addWindowListener( new WindowDestroyer( f, this ) );
  46.   f.addComponentListener( new WindowResizer( displayManager, this ) );
  47.   f.setResizable( true );
  48.   f.show();
  49.   //
  50.   // cache images
  51.   //
  52.   new ImageManager(this);  
  53.  
  54.   //
  55.   // Create balls
  56.   //
  57.   for (int i= 0; i< 5; i++) {
  58.      actorManager.addActor (new Ball(this));
  59.   } /*init*/ 
  60.  
  61.   //
  62.   // paint background image
  63.   //
  64.   displayManager.setBackgroundTile (getImage( getCodeBase(), "images/background.gif"));
  65.   start();
  66.   run();
  67. } /*init*/
  68.  
  69. public static void main( String[] args ) {
  70.     Boink gamelication = new Boink();
  71.     gamelication.init();
  72. }
  73.  
  74. } /*Boink*/
  75. @
  76.