home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 October / PCO1097.ISO / FilesBBS / FREI / MCII.EXE / GameObject.java < prev    next >
Encoding:
Java Source  |  1996-08-23  |  1.2 KB  |  47 lines

  1. /* GameObject.java - Abstract game object. */
  2.  
  3. /* 
  4.  * Copyright (C) 1996 Mark Boyns <boyns@sdsu.edu>
  5.  *
  6.  * Missile Commando II
  7.  * <URL:http://www.sdsu.edu/~boyns/java/mcii/>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  *
  14.  * This program is distributed in the hope that it will be useful,
  15.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  * GNU General Public License for more details.
  18.  *
  19.  * You should have received a copy of the GNU General Public License
  20.  * along with this program; if not, write to the Free Software
  21.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22.  */
  23.  
  24. import java.awt.Graphics;
  25. import java.awt.Color;
  26.  
  27. abstract
  28. class GameObject
  29. {
  30.     boolean alive = true;
  31.     boolean explode = false;
  32.     Color skyColor = new Color (148, 198, 231);
  33.     
  34.     abstract void erase (Graphics g);
  35.     abstract void paint (Graphics g);
  36.  
  37.     void explode ()
  38.     {
  39.     explode = true;
  40.     }
  41.  
  42.     boolean alive ()
  43.     {
  44.     return alive;
  45.     }
  46. }
  47.