基于java的雷电游戏GUI_swing游戏的设计与实现--源代码--【毕业设计】

本系列校训

互相伤害互相卷,玩命学习要你管,天生我才必有用,我命由我不由天!
毕业论文不怕难,毕业设计来铺垫!打磨技术精心写,拿证之后尽开颜!

毕设的技术铺垫

语言选择收录专辑链接卷的程度
C张雪峰推荐选择了计算机专业之后-在大学期间卷起来-【大学生活篇】★★★✫✰
JAVA黑马B站视频JAVA部分的知识范围、学习步骤详解★★★★★
JAVAWEB黑马B站视频JAVAWEB部分的知识范围、学习步骤详解★★★★★
SpringBootSpringBoot知识范围-学习步骤【JSB系列之000】★★★★★
微信小程序详细解析黑马微信小程序视频–【思维导图知识范围】★★★✰✰
python详细解析python视频选择–【思维导图知识范围】★★✫✰✰
phpPHP要怎么学–【思维导图知识范围】★★★✫✰

环境及工具:

本系列环境

环境win11
工具idea 2017
jdk1.8
数据库
maven
项目导入方式打开目录
数据库前端工具

项目说明

总体设计

总体功能

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

本毕业设计功能如图1所示

在这里插入图片描述

代码部分

文件编码问题。
在这里插入图片描述

项目文件目录如下:
在这里插入图片描述

关键核心代码:
应用软件的核心代码是指这个程序最关键部分的代码。例如WinRAR,它的核心代码就是压缩算法部分,而诸如用户界面、操作系统移植等部分就无足轻重了。
商城类的核心代码是指业务层的代码,比如你商城的核心代码就是:商品、购物车、创建订单、支付这些代码就是核心代码。

作为程序员,我们经常需要看懂别人的代码。特别是在开源社区中,我们需要理解许多优秀的开源项目的代码。而在Gitee这样的代码托管平台上,我们如何快速有效地看懂别人的代码呢?本文将为大家介绍一些方法。

1.阅读README和项目介绍

在Gitee上,许多开源项目都会有自己的README文件或项目介绍。这些文件一般会介绍项目的背景、功能、使用方法等内容,可以帮助我们快速了解这个开源项目的基本情况。如果我们能够从这些文件中找到与自己相关的内容,就可以快速入手这个开源项目的代码。

2.了解项目结构和代码组织

在阅读代码之前,我们需要先了解这个开源项目的代码结构和代码组织方式。通常,开源项目会将不同的功能模块封装到不同的代码文件中,并按照一定的目录结构组织起来。如果我们能够了解这个开源项目的代码组织方式,就能更加快速地找到所需的代码。

3.利用IDE和工具

IDE和一些代码阅读工具可以帮助我们更快速、更高效地阅读代码。例如,Java开发者可以使用Eclipse或IntelliJ IDEA这样的IDE,可以快速打开代码文件、查看类、方法和变量等信息。另外,一些代码阅读工具,如Source Insight、CodeCompare等,可以帮助我们更方便地查看代码的结构和关系,以及快速跳转到相关代码。

4.关注代码注释和文档

良好的代码注释和文档可以帮助我们更快速地理解代码。因此,在阅读别人的代码时,我们可以将注意力放在代码注释和文档上。有些开源项目会提供详细的文档,有些则注重代码注释。如果我们能够针对代码注释和文档有一个系统的阅读和理解,就能更快速地掌握别人的代码。

5.跑通测试和运行项目

如果我们想更深入地了解别人的代码,可以试着跑通相关的测试,或者直接运行这个开源项目。通过跑测试和运行项目,我们可以更加直观地了解代码的实现细节和具体的业务逻辑。

总结:

以上就是在Gitee上快速理解他人代码的一些方法,希望对大家有所帮助。当然,阅读代码是一件需要耐心和细心的事情,需要我们多花一点时间和心思。只有沉下心来,慢慢阅读每一行代码,才能真正理解它们的含义和作用。

package com.ideabobo.game.leidian;

import java.awt.Image;

abstract class Enemy extends Role {
	protected int tamaIntCount;

	protected Battle _battle;

	protected int power;

	protected int counter;

	protected int pattern;

	protected float vx;

	protected float vy;

	protected final int pattern0 = 0;

	protected final int pattern1 = 1;

	protected final int pattern2 = 2;

	protected final int pattern3 = 3;

	protected final int pattern4 = 4;

	protected final int pattern5 = 5;

	protected final int pattern6 = 6;

	protected final int pattern7 = 7;

	public Enemy(Battle battle, Image enemyImage) {
		super(enemyImage);
		this._battle = battle;
		tamaIntCount = 0;
		counter = 0;
	}

	public abstract void move();

	public void checkOutOfScreen() {
		if (y - 100F > (float) app.getHeight() || x + WIDTH + 100F < 0.0F
				|| x - 100F > (float) app.getWidth()
				|| y + HEIGHT + 100F < 0.0F)
			dead();
	}

	protected boolean checkHit(Role chara) {
		if ((chara instanceof BattleShot) && super.checkHit(chara)) {
			chara.dead();
			power--;
			if (power <= 0) {
				GamePanel.burst = new Burst(x, y);
				dead();
			}
			return true;
		} else {
			return false;
		}
	}

}

主面板

package com.ideabobo.game.leidian;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Panel;
import java.awt.Toolkit;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.Random;

public class GamePanel extends Panel implements Runnable {

	static final int WIDTH = 450;

	static final int HEIGHT = 500;

	private Thread gameThread;

	public static int gameMode;

	private Image offImage;
	//g_off在背景上面作画的画笔
	private Graphics g_off;

	public static Image heroImage;

	public static Image enemyImageA;

	public static Image enemyImageB;

	public static Image enemyImageC;

	public static Image enemyImageD;

	public static Image bossImageA;

	public static Image bossImageB;

	public static Image bossImageC;

	public static Image flagImage;

	public static Image zikiBeamImage;

	public static Image enemyBeamImage;

	public static Image enemyTamaImage;

	public static Image burstImage[] = new Image[16];

	public static Image largeBurstImage[] = new Image[16];

	public static Image splitBulletImage;

	public static Image HomingBulletImage;

	public static LinkedList list;

	public static LinkedList listTmp;

	public static final int STARTSCENE = 0;

	public static final int STAGE1 = 1;

	public static final int Stage1Clear = 4;

	public static final int InitSTAGE2 = 8;

	public static final int STAGE2 = 2;

	public static final int Stage2Start = 5;

	public static final int Stage2Clear = 6;

	public static final int InitSTAGE3 = 7;

	public static final int STAGE3 = 3;

	public static final int Stage3Clear = 9;

	public static final int Congratulation = 10;

	public static final int GAMEOVERSCENE = 11;

	public static final int READY = 12;

	public static final int APPEARING = 13;

	public static final int CREAR = 14;

	public static final int DISAPPEARING = 15;

	public static final int BOSS_DEATH = 16;

	static boolean AppearingFlag = true;

	static boolean DeathSeenAFlag = true;

	static boolean DeathSeenBFlag = true;

	static boolean DeathSeenCFlag = true;

	public static Burst burst;

	public static BigBurst largeBurst;

	public int t_loon_framework;
	
	Battle battle;

	Boss boss;

	public static int time = 0;
	
	public static int skillCount = 10;

	public StageA stageA;

	public StageB stageB;

	public StageC stageC;

	int current;

	Start star[];

	Random random;

	private int stage;

	private float heroX;

	private float zikiY;

	private float bossX;

	private float bossY;

	private int bossDeathAnimeCount;
	
	public int skillAnimeCount;
	
	private static final long serialVersionUID = 1L;

	public GamePanel() {

		offImage = null;
		current = 0;
		//新建Start类型数组大小为20
		star = new Start[Start.num_Star];
		//调整窗口尺寸
		setPreferredSize(new Dimension(450, 500));
		Role.app = this;
		list = new LinkedList();
		listTmp = new LinkedList();
		heroImage = loadImage("image/this.gif");
		enemyImageA = loadImage("image/enemyA.gif");
		enemyImageB = loadImage("image/enemyB.gif");
		enemyImageC = loadImage("image/enemyC.gif");
		enemyImageD = loadImage("image/enemyD.gif");
		bossImageA = loadImage("image/bossA.gif");
		bossImageB = loadImage("image/bossB.gif");
		bossImageC = loadImage("image/bossC.gif");
		flagImage = loadImage("image/ballSilver.gif");
		zikiBeamImage = loadImage("image/beam2.gif");
		enemyBeamImage = loadImage("image/beam3.gif");
		enemyTamaImage = loadImage("image/ballRed.gif");
		//爆炸图片数组
		for (int i = 0; i < 16; i++)
			burstImage[i] = loadImage("image/burst" + i + ".gif");
		//蓝色圆形子弹
		splitBulletImage = loadImage("image/ballBlue.gif");
		//大型爆炸图片数组
		for (int i = 0; i < 16; i++)
			largeBurstImage[i] = loadImage("image/largeBurst" + i + ".gif");
		//绿色圆形子弹
		HomingBulletImage = loadImage("image/ballGreen.gif");

		gameMode = 0;
		stage = 1;
		random = new Random();
		for (int i = 0; i < Start.num_Star; i++){
			//Start(int x, int y, int vy, int width, Color color)
			star[i] = new Start(Math.abs(random.nextInt()) * 450, Math
					.abs(random.nextInt()) * 500, 5 * Math
					.abs(random.nextInt()), 5 * Math.abs(random.nextInt()),
					Color.white);
		}
		addKeyListener(new Key());
		setFocusable(true);
		requestFocus();
		setBackground(Color.black);
		setForeground(Color.white);
		gameThread = new Thread(this);
		gameThread.start();
	}

	public void run() {
		while (gameThread == Thread.currentThread()) {
			//画黑色的背景
			gameRender();
			//g_off在背景上面作画的画笔
			if (g_off != null) {
				long RefreshTime = System.currentTimeMillis();
				try {
					Thread.sleep(2L);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
				switch (gameMode) {
				case 0:
					title();
					break;

				case 1:
					stage1();
					break;

				case 12:
					ready();
					break;

				case 14:
					crear();
					break;

				case 13: 
					appearingAnime();
					break;

				case 2:
					stage2();
					break;
				case 3: 
					stage3();
					break;

				case 10: 
					congratulation();
					break;

				case 11: 
					gameOver();
					break;

				case 15: 
					disappearing();
					break;

				case 16: 
					bossDeathAnime();
					break;
				}
				paintScreen();
				current++;
				while (System.currentTimeMillis() - RefreshTime < 13L);
			}
		}
	}

	private void disappearing() {
		g_off.setColor(Color.white);
		Font font = new Font("宋体", 1, 28);
		g_off.setFont(font);
		g_off.drawString("关卡 " + stage + " 完结", 100, 250);
		battle.setPower(battle.getPowerMax());
		if (zikiY + battle.getHeight() > 0.0F) {
			g_off.drawImage(battle.getImage(), (int) heroX, (int) zikiY, null);
		} else {
			gameMode = 12;
			stage++;
		}
		if (stage == 4) {
			gameMode = 10;
		}
		//**//--///loonframewrk提供
		zikiY -= 2.0F;
	}

	private void crear() {
		if (stage == 1) {
			gameMode = 16;
		} else if (stage == 2) {
			gameMode = 16;
		} else if (stage == 3) {
			gameMode = 16;
		}
	}

	private void bossDeathAnime() {
		if (bossY + boss.getHeight() > 0.0F) {
			g_off.drawImage(boss.getImage(), (int) bossX, (int) bossY, null);
			if (bossDeathAnimeCount % 5 == 0) {
				burst = new Burst((float) ((double) bossX + (double) boss
						.getWidth()
						* Math.random()),
						(float) ((double) bossY + (double) boss.getHeight()
								* Math.random()));
				burst.draw(g_off);
			}
			g_off.drawImage(battle.getImage(), (int) heroX, (int) zikiY, null);
			bossDeathAnimeCount++;
			bossY--;
		} else {
			gameMode = 15;
		}
	}
	
	public  void skillAnime(){
		if (skillAnimeCount % 5 == 0) {
			burst = new Burst((float) (400* Math.random()),(float) (300* Math.random()));
			burst.draw(g_off);
		}
		skillAnimeCount++;
	}

	private void stage1() {
		StageA.start();
		gameMain();
	}

	private void stage2() {
		StageB.start();
		gameMain();
	}

	private void stage3() {
		StageC.start();
		gameMain();
	}

	private void congratulation() {
		g_off.setColor(Color.white);
		g_off.drawString("恭喜", 100, 250);
	}
//关卡开始的准备画面
	private void ready() {
		bossDeathAnimeCount = 0;
		skillAnimeCount = 0;
		time = 0;
		list.clear();
		listTmp.clear();
		battle = new Battle();
		heroX = battle.getX();
		zikiY = battle.getY() + battle.getHeight() * 4F;
		switch (stage) {
		case 1:
			stageA = new StageA(battle);
			break;

		case 2:
			stageB = new StageB(battle);
			break;

		case 3:
			stageC = new StageC(battle);
			break;
		}
		addList(battle);
		gameMode = 13;
	}

	private void appearingAnime() {
		g_off.setColor(Color.white);
		g_off.drawString("STAGE" + stage, 160, 250);
		if (zikiY < 500F - battle.getHeight() * 2.0F) {
			gameMode = stage;
		} else {
			g_off.drawImage(battle.getImage(), (int) heroX, (int) zikiY, null);
		}
		zikiY -= 2.0F;
	}
//显示第一个画面,按回车后进入关卡开始准备界面
	private void title() {
		if (Key.enter) {
			gameMode = 12;
		} else {
			g_off.setColor(Color.white);
			Font font = new Font("华文新魏",1, 45);
			g_off.setFont(font);
			FontMetrics fontMetrics = getFontMetrics(font);
			g_off.drawString("飞机大战", (450 - fontMetrics
					.stringWidth("飞机大战")) / 2, (500 + fontMetrics
					.getHeight()) / 2 - 50);
			if (15 <= current % 50)
				g_off.drawString("开始请按 ENTER", (450 - fontMetrics
						.stringWidth("开始请按 ENTER")) / 2,
						(500 + fontMetrics.getHeight()) / 2 + 100);
		}
	}

	private void gameOver() {
		GamePanel.skillCount = 10;
		if (Key.enter) {
			gameMode = 12;
			stage = 1;
		} else {
			g_off.setColor(Color.white);
			Font font = new Font("黑体", 1, 28);
			g_off.setFont(font);
			FontMetrics fontMetrics = getFontMetrics(font);
			g_off.drawString("Game Over", (450 - fontMetrics
					.stringWidth("Game Over")) / 2, (500 + fontMetrics
					.getHeight()) / 2 - 50);
			if (15 <= current % 50)
				g_off.drawString("请按 ENTER", (450 - fontMetrics
						.stringWidth("请按 ENTER")) / 2,
						(500 + fontMetrics.getHeight()) / 2 + 100);
		}
	}
//画黑色的背景
	private void gameRender() {
		if (offImage == null) {
			offImage = createImage(450, 500);
			if (offImage == null){
				return;
			}
			g_off = offImage.getGraphics();
		}
		g_off.setColor(Color.BLACK);
		g_off.fillRect(0, 0, 450, 500);
	}

	public void paintScreen() {
		try {
			Graphics g = getGraphics();
			if (g != null && offImage != null)
				g.drawImage(offImage, 0, 0, null);
			Toolkit.getDefaultToolkit().sync();
			if (g != null)
				g.dispose();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
//整个画面帧
	private void gameMain() {
		for (int i = 0; i < Start.num_Star; i++){
			//如果敌人死了随机产生一个
			if (star[i].death())
				star[i] = new Start((int) (450D * Math.random()),
						(int) (500D * Math.random()),
						(int) (4D * Math.random()) + 2, (int) (5D * Math
								.random()) + 1, Color.white);
		}
		for (int i = 0; i < Start.num_Star; i++){
			star[i].move();
		}
			

		for (int i = 0; i < Start.num_Star; i++){
			star[i].draw(g_off);
		}
			
		//画主角的血量
		battle.drawPower(g_off);
		battle.drawSkillCount(g_off);
		for (int i = 0; i < list.size(); i++) {
			Role chara1 = (Role) list.get(i);
			for (int j = 0; j < list.size(); j++) {
				Role chara2 = (Role) list.get(j);
				chara1.checkHit(chara2);
			}

		}

		for (int i = 0; i < list.size(); i++) {
			Role chara1 = (Role) list.get(i);
			if (chara1 instanceof Boss) {
				boss = (Boss) chara1;
				if (!boss.isDead()) {
					boss.drawPower(g_off);
				} else {
					bossX = boss.getX();
					bossY = boss.getY();
					heroX = battle.getX();
					zikiY = battle.getY();
					gameMode = 14;
				}
			}
		}

		for (int i = list.size() - 1; i >= 0; i--) {
			Role chara1 = (Role) list.get(i);
			chara1.move();
			chara1.draw(g_off);
		}

		if (burst != null)
			burst.draw(g_off);
		for (int i = 0; i < list.size(); i++) {
			Role chara1 = (Role) list.get(i);
			if (chara1.isDead()) {
				if (chara1 instanceof Enemy)
					chara1.drawBurst(g_off);
				list.remove(i);
			}
		}

		for (int i = 0; i < listTmp.size(); i++){
			list.add(listTmp.get(i));
		}
			

		if (battle.isDead()) {
			gameMode = 11;
		}
		listTmp.clear();
		time++;
	}
//添加对象到listTmp
	public static void addList(Role chara) {
		listTmp.add(chara);
	}

	public int getWidth() {
		return 450;
	}

	public int getHeight() {
		return 500;
	}

	public Image loadImage(String str) {
		InputStream is = null;
		try {
			is = GamePanel.class.getResourceAsStream(str);
		} catch (Exception e) {
			is = null;
		}
		// System.out.println("结果="+str);
		ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
		byte[] arrayByte = null;
		try {
			byte[] bytes = new byte[4096];
			bytes = new byte[is.available()];
			int read;
			while ((read = is.read(bytes)) >= 0) {
				byteArrayOutputStream.write(bytes, 0, read);
			}
			arrayByte = byteArrayOutputStream.toByteArray();
		} catch (IOException e) {
			System.err.println("Image Loader IQ Exception " + e.getMessage());
			return null;
		} finally {
			try {
				if (byteArrayOutputStream != null) {
					byteArrayOutputStream.close();
					byteArrayOutputStream = null;
				}
				if (is != null) {
					is.close();
					is = null;
				}

			} catch (IOException e) {
				System.err
						.println("Image Close IQ Exception " + e.getMessage());
			}

		}
		Image result = Toolkit.getDefaultToolkit().createImage(arrayByte);
		if (result != null)
			waitImage(result);
		else
			System.out.println("File not found. ( " + str + " )");
		return result;
	}

	/**
	 * 同步方法,使产生图像时间一致。
	 * 
	 * @param image
	 */
	private final static void waitImage(Image image) {
		try {
			Toolkit toolkit = Toolkit.getDefaultToolkit();
			for (int i = 0; i < 100; i++) {
				if (toolkit.prepareImage(image, -1, -1, null))
					return;
				Thread.currentThread();
				Thread.sleep(100L);
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}



}

控制的部分

package com.ideabobo.game.leidian;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Image;

import com.ideabobo.game.leidian.Boss;

public class Battle extends Role {
	private static Battle battle = new Battle();

	private int tamaIntCount;

	private float speed;

	private float oldx;

	private float oldy;

	public static float vx;

	public static float vy;
	
	public static boolean keygo = false;

	private float tv[] = { -1F, -7F, 0.0F, -8F, 1.0F, -7F };

	public int power;

	public int powerMax;
	


	public Battle() {
		super(GamePanel.heroImage);
		speed = 3F;
		tamaIntCount = 0;
		x = ((float) app.getWidth() - WIDTH) / 2.0F;
		y = (float) app.getHeight() - HEIGHT * 2.0F;
		power = 600;
		powerMax = power;
	}

	public static Battle getInstance() {
		return battle;
	}

	public void move() {
		oldx = x;
		oldy = y;
		if (Key.left) {
			if (Key.xkey)
				x -= (double) speed / 4D;
			else
				x -= speed;
			if (x <= 0.0F)
				x = 0.0F;
		}
		if (Key.right) {
			if (Key.xkey)
				x += (double) speed / 4D;
			else
				x += speed;
			if (x + WIDTH >= (float) app.getWidth())
				x = (float) app.getWidth() - WIDTH;
		}
		if (Key.down) {
			if (Key.xkey)
				y += (double) speed / 4D;
			else
				y += speed;
			if (y + HEIGHT >= (float) app.getHeight())
				y = (float) app.getHeight() - HEIGHT;
		}
		if (Key.up) {
			if (Key.xkey)
				y -= (double) speed / 4D;
			else
				y -= speed;
			if (y <= 0.0F)
				y = 0.0F;
		}
		//**//--///loonframewrk提供
		vx = x - oldx;
		vy = y - oldy;
		if (tamaIntCount > 0)
			tamaIntCount--;
		if (Key.zkey && tamaIntCount <= 0) {
			for (int i = 0; i < tv.length; i += 2) {
				GamePanel.addList(new BattleBasic(x + WIDTH / 2.0F, y, tv[i],
						tv[i + 1]));
				tamaIntCount = 8;
			}
		}
		if (Key.xkey && !Key.zkey && tamaIntCount <= 0) {
			GamePanel.addList(new BattleBeam(x + WIDTH / 2.0F, y, 0.0F, -8F));
			tamaIntCount = 2;
		}
		if(Key.space){
			if(!keygo){
				GamePanel.skillCount--;
			}
			app.skillAnime();
			
			if(GamePanel.skillCount < 0){
				GamePanel.skillCount = 0;
			}
			if(GamePanel.skillCount>0){
				for (int i = 0; i < GamePanel.list.size(); i++) {
					Role chara1 = (Role) GamePanel.list.get(i);
					if(!(chara1 instanceof Battle) && chara1.x>0 && chara1.y>0 && !(chara1 instanceof BossA)  && !(chara1 instanceof BossB)  && !(chara1 instanceof BossC)){
						GamePanel.list.remove(i);
					}else if((chara1 instanceof BossA)  || (chara1 instanceof BossB)  || (chara1 instanceof BossC)){
						Boss cb = (Boss)chara1;
						cb.power-=50;
					}
				}
			}
			keygo = true;
		}
		
		if(!Key.space){
			keygo = false;
		}
	}

	public boolean checkHit(Role chara) {
		if ((chara instanceof EnemyA) || (chara instanceof EnemyB)|| (chara instanceof EnemyC) || (chara instanceof EnemyShot)) {
			
			if ((x + WIDTH) - 14F > chara.x && x + 14F < chara.x + chara.WIDTH
					&& (y + HEIGHT) - 12F > chara.y
					&& y + 12F < chara.y + chara.HEIGHT) {
				//如果碰到敌人,敌人死亡
				chara.dead();
				//如果碰到子弹血量减少
				if (chara instanceof EnemyBeam){
					power--;
				}
					
				power -= 50;
				if (power <= 0) {
					dead();
					//绘制爆炸图片
					GamePanel.burst = new Burst(x, y);
				}
				return true;
			}
		} else if ((chara instanceof Boss) && (x + WIDTH) - 14F > chara.x + 50F
				&& x + 14F < (chara.x + chara.WIDTH) - 50F
				&& (y + HEIGHT) - 12F > chara.y + 50F
				&& y + 12F < (chara.y + chara.HEIGHT) - 80F) {
			power--;
			if (power <= 0) {
				dead();
				GamePanel.burst = new Burst(x, y);
			}
			return true;
		}
		return false;
	}

	public void setX(float x) {
		this.x = x;
	}

	public void setY(float y) {
		this.y = y;
	}

	public float getWidth() {
		return WIDTH;
	}

	public float getHeight() {
		return HEIGHT;
	}

	public float getX() {
		return x;
	}

	public float getY() {
		return y;
	}

	public Image getImage() {
		return img;
	}

	public int getPower() {
		return power;
	}

	public int getPowerMax() {
		return powerMax;
	}

	public void setPower(int power) {
		this.power = power;
	}

	public void drawPower(Graphics g) {
		g.setColor(Color.white);
		g.drawRect(380, 450, 50, 15);
		g.setColor(Color.red);
		g.fillRect(381, 451,
				(int) ((50D / (double) (float) powerMax) * (double) power) - 1,
				14);
	}
	
	public void drawSkillCount(Graphics g){
		g.setColor(Color.white);
		Font font = new Font("宋体", 1, 20);
		g.setFont(font);
		g.drawString("全屏爆破:" + GamePanel.skillCount, 0, 450);
	}

}



界面

在这里插入图片描述

在这里插入图片描述

BOSS关

在这里插入图片描述
玩家飞机子弹有两种方式,
散弹与激光模式
在这里插入图片描述
在这里插入图片描述

论文参考
基于java的坦克大战游戏的设计与实现–毕业论文–【毕业论文】
https://blog.csdn.net/dearmite/article/details/131962993

配套资源

基于java的坦克大战游戏的设计与实现–源代码–【毕业设计】
https://download.csdn.net/download/dearmite/88118051

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

项目花园范德彪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值