|
SpaceOddysy: Chapter 4
The similarly subclass the other abstract classes to get concrete implementations.
//Weapons.java
public abstract class Weapon implements Artifact,Moving{
double xPos,yPos;//
double xSpeed,ySpeed;
double damage;
boolean right,up;
boolean alive=true;
..........................
The weapons class is subclassed to Bullet, EnemyBullet and Mines.
//PowerUp.java
public class PowerUp implements Artifact,Drawable,Moving,
Serializable{
double xPos,yPos;
double xSpeed,ySpeed;
int size;
....................
The PowerUp class is subclassed to LifeUp, MoneyUp, SpeedUp, BulletsUp
and MinesUp, the various types of powerUps in the game.
//SpaceScape.java
public abstract class SpaceScape implements Artifact,
Serializable{
double xPos,yPos;//position
double xSpeed,ySpeed;//speed
int size;
................
This class is subclassed to Planets.
Next Chapter>>>>>
|