Import Jav Export Java

935 WordsMay 21, 20164 Pages
package spaceinvaders; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.util.ArrayList; import java.util.Iterator; import java.util.Random; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JPanel; public class Board extends JPanel implements Runnable, CommonVars, ActionListener { private Dimension d; private ArrayList aliens; private Player player; private Shot shot; private int alienX = 150; private int alienY = 5; private int direction = -1; private int deaths = 0; private boolean ingame = true; private String message = "Game Over"; private Thread animator; private JButton replay; public Board() { addKeyListener( new TAdapter() ); setFocusable( true ); d = new Dimension( bWIDTH, bHEIGHT ); setBackground( Color.black ); gameInit(); setDoubleBuffered( true ); } public void addNotify() { super.addNotify(); gameInit(); } public void gameInit() { aliens = new ArrayList(); ImageIcon ii = new ImageIcon( "c:/users/bchatterjee073/spaceinvaders/alien.png" ); for ( int i = 0; i < 4; i++ ) { for

More about Import Jav Export Java

Open Document