資源簡介
經典飛機大戰,通過鼠標移動控制飛機移動擊落敵機獲得得分,在擊落敵機的同時注意規避敵機子彈,在飛行過程中隨機掉落道具,子彈增加,以及補充血量,清屏敵機。在擊落boss后游戲通關。
學習線程的經典案例
代碼片段和文件信息
package?day08;
import?java.awt.Graphics;
import?java.awt.Image;
public?class?Award?{
?//定義道具的坐標
??int?xy;
?//定義存放道具的圖片素組
??Image?img;
?//定義道具的存活
??boolean?isLive=false;
??//定義道具的類型
??int?type;
?//畫道具
??public?Award(int?x?int?y?Image?imgint?type)?{
super();
this.x?=?x;
this.y?=?y;
this.img?=?img;
this.type=type;
}
??public?void?draw(Graphics?g){
??g.drawImage(imgxynull);
??}
//道具移動
??public?void?move(){
??if(isLive){
??y+=5;
??}
??if(y>=600){
??isLive=false;
??}
??}
??//英雄機吃道具
??public?boolean?eatAward(ShootJPanel?panel){
??boolean?f=false;
??if(panel.hx+panel.p[0].getWidth()/2>=x&&panel.hx+panel.p[0].getWidth()/2<=x+img.getWidth(null)
&&panel.hy+panel.p[0].getHeight()/2>=y&&panel.hy+panel.p[0].getHeight()/2<=y+img.get
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????301??2017-07-06?12:47??7-6_ex1\.classpath
?????文件????????383??2017-07-06?12:47??7-6_ex1\.project
?????文件?????????75??2017-07-07?12:19??7-6_ex1\.settings\org.eclipse.core.resources.prefs
?????文件????????598??2017-07-06?12:47??7-6_ex1\.settings\org.eclipse.jdt.core.prefs
?????文件????????822??2017-12-04?17:54??7-6_ex1\bin\day01\FirstJfr
?????文件???????1437??2017-12-04?17:54??7-6_ex1\bin\day01\FirstJPanel.class
?????文件????????854??2017-12-04?17:54??7-6_ex1\bin\day02\ClockJfr
?????文件???????1163??2017-12-04?17:54??7-6_ex1\bin\day02\ClockJPanel$1.class
?????文件????????880??2017-12-04?17:54??7-6_ex1\bin\day02\ClockJPanel$2.class
?????文件???????3351??2017-12-04?17:54??7-6_ex1\bin\day02\ClockJPanel.class
?????文件???????1197??2017-12-04?17:54??7-6_ex1\bin\day03\ArrayListTest.class
?????文件???????1103??2017-12-04?17:54??7-6_ex1\bin\day03\BallJfr
?????文件???????1653??2017-12-04?17:54??7-6_ex1\bin\day03\BallJPanel$1.class
?????文件???????2230??2017-12-04?17:54??7-6_ex1\bin\day03\BallJPanel.class
?????文件???????1497??2017-12-04?17:54??7-6_ex1\bin\day03_pm\Ball.class
?????文件???????2682??2017-12-04?17:54??7-6_ex1\bin\day03_pm\BallCollection.class
?????文件???????1125??2017-12-04?17:54??7-6_ex1\bin\day03_pm\BallJfr
?????文件???????2890??2017-12-04?17:54??7-6_ex1\bin\day03_pm\BallJPanel02$1.class
?????文件???????4294??2017-12-04?17:54??7-6_ex1\bin\day03_pm\BallJPanel02.class
?????文件????????998??2017-12-04?17:54??7-6_ex1\bin\day03_pm\Board.class
?????文件????????799??2017-12-04?17:54??7-6_ex1\bin\day03_pm\Diamonds.class
?????文件???????1613??2017-12-04?17:54??7-6_ex1\bin\day03_pm\ListTest.class
?????文件???????1453??2017-12-04?17:54??7-6_ex1\bin\day08\Award.class
?????文件???????2063??2017-12-04?17:54??7-6_ex1\bin\day08\Bullet.class
?????文件???????2640??2017-12-04?17:54??7-6_ex1\bin\day08\EnemyPlane.class
?????文件???????1116??2017-12-04?17:54??7-6_ex1\bin\day08\ShootJfr
?????文件??????11808??2017-12-04?17:54??7-6_ex1\bin\day08\ShootJPanel.class
?????文件???????4096??2017-07-15?19:13??7-6_ex1\images\._plan1.png
?????文件???????4096??2017-07-15?19:13??7-6_ex1\images\._plan1_spec.png
?????文件???????7891??2017-07-15?19:13??7-6_ex1\images\1.png
............此處省略85個文件信息
評論
共有 條評論