-
大小: 3.89MB文件類型: .zip金幣: 2下載: 0 次發(fā)布日期: 2023-12-24
- 語(yǔ)言: Java
- 標(biāo)簽: java基礎(chǔ)??
資源簡(jiǎn)介
基于java基礎(chǔ)知識(shí)開發(fā)的飛機(jī)大戰(zhàn)項(xiàng)目,對(duì)于java
初學(xué)者有很好的指引作用,便于了解java基礎(chǔ)的知識(shí)點(diǎn)。

代碼片段和文件信息
package?planewar.client;
import?java.awt.Color;
import?java.awt.Font;
import?java.awt.Graphics;
import?java.awt.Image;
import?java.awt.event.KeyAdapter;
import?java.awt.event.KeyEvent;
import?java.util.ArrayList;
import?java.util.List;
import?java.util.Timer;
import?java.util.TimerTask;
import?java.util.concurrent.Executor;
import?java.util.concurrent.ScheduledExecutorService;
import?javax.tools.Diagnostic;
import?planewar.core.BackGround;
import?planewar.core.Blood;
import?planewar.core.Boss;
import?planewar.core.Bullet;
import?planewar.core.Direction;
import?planewar.core.EnemyPlane;
import?planewar.core.Explode;
import?planewar.core.Images;
import?planewar.core.Onetask;
import?planewar.core.Plane;
import?planewar.core.SuperBullet;
import?planewar.core.Twotask;
import?planewar.core.integral;
import?planewar.csonstant.Constant;
import?planewar.util.Gameutil;
import?planewar.util.Myframe;
/**
?*?運(yùn)行飛機(jī)大戰(zhàn)項(xiàng)目的主類(客戶端)
?*?
?*?@author?丁俊鑫
?*
?*/
public?class?PlaneWarSystem?extends?Myframe?{
//?背景圖片
BackGround?bg?=?new?BackGround();
//?我方飛機(jī)
public?Plane?myplane?=?new?Plane(this?Constant.Game_WIDTH?/?2?-?Images.imgs.get(“plane“).getWidth(null)?/?2
Constant.Game_HEIGHT?-?Images.imgs.get(“plane“).getHeight(null)?Images.imgs.get(“plane“));
//?子彈
Plane?bullet?=?new?Plane(this?300?600?Images.imgs.get(“bullet“));
//?敵方飛機(jī)容器
public?List?enemies?=?new?ArrayList<>();
//?子彈容器
public?List?bullets?=?new?ArrayList<>();
//?boss容器
public?List?bosses?=?new?ArrayList<>();
//?爆炸效果
public?List?explodes?=?new?ArrayList<>();
//?血條效果
public?List?bloods?=?new?ArrayList<>();
//?大招效果
public?List?superbullets?=?new?ArrayList<>();
//積分效果
public?List?integrals?=?new?ArrayList<>();
/**
?*?SuperBullet?s=new?SuperBullet();
?*?EnemyPlane(this500100Images.imgs.get(“EnemyPlane“)Direction.DOWN);?Bullet
?*?bullet=new?Bullet(350350“img/bullet.png“Direction.UP);?爆炸效果?public?Explode
?*?e?=?new?Explode(this200200);?public?Blood?blood=new?Blood(this200300);
?*/
@Override
public?void?launchframe()?{
//?調(diào)用父類的方法
super.launchframe();
//?插入鍵盤監(jiān)聽器
this.addKeyListener(new?KeyAdapter()?{
@Override
public?void?keyPressed(KeyEvent?e)?{
myplane.keyPressed(e);
//?System.out.println(e.getKeyCode()?+?“按住鍵了“);
}
public?void?keyReleased(KeyEvent?e)?{
myplane.keyReleased(e);
}
});
// //創(chuàng)建一個(gè)boss對(duì)象
// Boss?boss?=?new?Boss(this);
// //創(chuàng)建boss
// bosses.add(boss);
Timer?time=new??Timer();
??? Twotask?twoTask=new?Twotask(this);
??? time.schedule(twoTask?3000030000);
//?游戲開始時(shí)創(chuàng)建敵人飛機(jī)
//定時(shí)器創(chuàng)建
Timer?timer=new??Timer();
??? Onetask?secondTask=new?Onetask(this);
??? timer.schedule(secondTask?10003000);
// EnemyPlane?enemy?=?new?EnemyPlane(this?100?-100?Images.imgs.get(“EnemyPlane“));
// enemies.add(enemy);
}
@Override
public?void?paint(Graphics?g
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\
?????文件?????????301??2018-03-12?08:54??飛機(jī)大戰(zhàn)\plane_war\.classpath
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\
?????目錄???????????0??2018-04-11?19:11??飛機(jī)大戰(zhàn)\plane_war\.git\branches\
?????文件??????????12??2018-04-11?19:13??飛機(jī)大戰(zhàn)\plane_war\.git\COMMIT_EDITMSG
?????文件?????????286??2018-04-11?19:12??飛機(jī)大戰(zhàn)\plane_war\.git\config
?????文件??????????23??2018-04-11?19:11??飛機(jī)大戰(zhàn)\plane_war\.git\HEAD
?????目錄???????????0??2018-04-11?19:11??飛機(jī)大戰(zhàn)\plane_war\.git\hooks\
?????文件????????5680??2018-04-11?19:11??飛機(jī)大戰(zhàn)\plane_war\.git\index
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\logs\
?????文件?????????500??2018-04-11?19:13??飛機(jī)大戰(zhàn)\plane_war\.git\logs\HEAD
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\logs\refs\
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\logs\refs\heads\
?????文件?????????500??2018-04-11?19:13??飛機(jī)大戰(zhàn)\plane_war\.git\logs\refs\heads\master
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????文件?????????154??2018-04-11?19:11??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????文件?????????186??2018-04-11?19:11??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????文件??????121982??2018-04-11?19:11??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????文件?????????431??2018-04-11?19:11??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????文件?????????572??2018-04-11?19:11??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????文件?????????147??2018-04-11?19:13??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????文件??????488978??2018-04-11?19:11??飛機(jī)大戰(zhàn)\plane_war\.git\ob
?????目錄???????????0??2018-05-04?08:52??飛機(jī)大戰(zhàn)\plane_war\.git\ob
............此處省略244個(gè)文件信息
評(píng)論
共有 條評(píng)論