简单的飞机大战游戏importjava.awt.Color;importjava.awt.Graphics;importjava.awt.Image;importjava.awt.event.MouseEvent;importjava.awt.event.MouseMotionListener;importjava.util.ArrayList;importjava.util.Random;importjavax.swing.ImageIcon;importjavax.swing.JPanel;publicclassMyJPanelextendsJPanelimplementsRunnable,MouseMotionListener{ Yingxiongjiyingxiong=newYingxiongji(); ArrayListzidans=newArrayList(); booleanisFire=false;//是否冒泡(发射) booleanpass=false; ArrayListdijis=newArrayList();//保存所有的敌机 intdicount=15; ImageyingxiongImg=null; ImagezidanImg=null; ImagedijiImgs[]=newImage[15]; ImagebeijingImg=null; intbeijingY=-720; Randomran=newRandom();
1