整体框架

#mermaid-svg-kwIdYePfSf2yisnx .label{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);fill:#333;color:#333}#mermaid-svg-kwIdYePfSf2yisnx .label text{fill:#333}#mermaid-svg-kwIdYePfSf2yisnx .node rect,#mermaid-svg-kwIdYePfSf2yisnx .node circle,#mermaid-svg-kwIdYePfSf2yisnx .node ellipse,#mermaid-svg-kwIdYePfSf2yisnx .node polygon,#mermaid-svg-kwIdYePfSf2yisnx .node path{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-kwIdYePfSf2yisnx .node .label{text-align:center;fill:#333}#mermaid-svg-kwIdYePfSf2yisnx .node.clickable{cursor:pointer}#mermaid-svg-kwIdYePfSf2yisnx .arrowheadPath{fill:#333}#mermaid-svg-kwIdYePfSf2yisnx .edgePath .path{stroke:#333;stroke-width:1.5px}#mermaid-svg-kwIdYePfSf2yisnx .flowchart-link{stroke:#333;fill:none}#mermaid-svg-kwIdYePfSf2yisnx .edgeLabel{background-color:#e8e8e8;text-align:center}#mermaid-svg-kwIdYePfSf2yisnx .edgeLabel rect{opacity:0.9}#mermaid-svg-kwIdYePfSf2yisnx .edgeLabel span{color:#333}#mermaid-svg-kwIdYePfSf2yisnx .cluster rect{fill:#ffffde;stroke:#aa3;stroke-width:1px}#mermaid-svg-kwIdYePfSf2yisnx .cluster text{fill:#333}#mermaid-svg-kwIdYePfSf2yisnx div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:12px;background:#ffffde;border:1px solid #aa3;border-radius:2px;pointer-events:none;z-index:100}#mermaid-svg-kwIdYePfSf2yisnx .actor{stroke:#ccf;fill:#ECECFF}#mermaid-svg-kwIdYePfSf2yisnx text.actor>tspan{fill:#000;stroke:none}#mermaid-svg-kwIdYePfSf2yisnx .actor-line{stroke:grey}#mermaid-svg-kwIdYePfSf2yisnx .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333}#mermaid-svg-kwIdYePfSf2yisnx .messageLine1{stroke-width:1.5;stroke-dasharray:2, 2;stroke:#333}#mermaid-svg-kwIdYePfSf2yisnx #arrowhead path{fill:#333;stroke:#333}#mermaid-svg-kwIdYePfSf2yisnx .sequenceNumber{fill:#fff}#mermaid-svg-kwIdYePfSf2yisnx #sequencenumber{fill:#333}#mermaid-svg-kwIdYePfSf2yisnx #crosshead path{fill:#333;stroke:#333}#mermaid-svg-kwIdYePfSf2yisnx .messageText{fill:#333;stroke:#333}#mermaid-svg-kwIdYePfSf2yisnx .labelBox{stroke:#ccf;fill:#ECECFF}#mermaid-svg-kwIdYePfSf2yisnx .labelText,#mermaid-svg-kwIdYePfSf2yisnx .labelText>tspan{fill:#000;stroke:none}#mermaid-svg-kwIdYePfSf2yisnx .loopText,#mermaid-svg-kwIdYePfSf2yisnx .loopText>tspan{fill:#000;stroke:none}#mermaid-svg-kwIdYePfSf2yisnx .loopLine{stroke-width:2px;stroke-dasharray:2, 2;stroke:#ccf;fill:#ccf}#mermaid-svg-kwIdYePfSf2yisnx .note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-kwIdYePfSf2yisnx .noteText,#mermaid-svg-kwIdYePfSf2yisnx .noteText>tspan{fill:#000;stroke:none}#mermaid-svg-kwIdYePfSf2yisnx .activation0{fill:#f4f4f4;stroke:#666}#mermaid-svg-kwIdYePfSf2yisnx .activation1{fill:#f4f4f4;stroke:#666}#mermaid-svg-kwIdYePfSf2yisnx .activation2{fill:#f4f4f4;stroke:#666}#mermaid-svg-kwIdYePfSf2yisnx .mermaid-main-font{font-family:"trebuchet ms", verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-kwIdYePfSf2yisnx .section{stroke:none;opacity:0.2}#mermaid-svg-kwIdYePfSf2yisnx .section0{fill:rgba(102,102,255,0.49)}#mermaid-svg-kwIdYePfSf2yisnx .section2{fill:#fff400}#mermaid-svg-kwIdYePfSf2yisnx .section1,#mermaid-svg-kwIdYePfSf2yisnx .section3{fill:#fff;opacity:0.2}#mermaid-svg-kwIdYePfSf2yisnx .sectionTitle0{fill:#333}#mermaid-svg-kwIdYePfSf2yisnx .sectionTitle1{fill:#333}#mermaid-svg-kwIdYePfSf2yisnx .sectionTitle2{fill:#333}#mermaid-svg-kwIdYePfSf2yisnx .sectionTitle3{fill:#333}#mermaid-svg-kwIdYePfSf2yisnx .sectionTitle{text-anchor:start;font-size:11px;text-height:14px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-kwIdYePfSf2yisnx .grid .tick{stroke:#d3d3d3;opacity:0.8;shape-rendering:crispEdges}#mermaid-svg-kwIdYePfSf2yisnx .grid .tick text{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-kwIdYePfSf2yisnx .grid path{stroke-width:0}#mermaid-svg-kwIdYePfSf2yisnx .today{fill:none;stroke:red;stroke-width:2px}#mermaid-svg-kwIdYePfSf2yisnx .task{stroke-width:2}#mermaid-svg-kwIdYePfSf2yisnx .taskText{text-anchor:middle;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-kwIdYePfSf2yisnx .taskText:not([font-size]){font-size:11px}#mermaid-svg-kwIdYePfSf2yisnx .taskTextOutsideRight{fill:#000;text-anchor:start;font-size:11px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-kwIdYePfSf2yisnx .taskTextOutsideLeft{fill:#000;text-anchor:end;font-size:11px}#mermaid-svg-kwIdYePfSf2yisnx .task.clickable{cursor:pointer}#mermaid-svg-kwIdYePfSf2yisnx .taskText.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-kwIdYePfSf2yisnx .taskTextOutsideLeft.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-kwIdYePfSf2yisnx .taskTextOutsideRight.clickable{cursor:pointer;fill:#003163 !important;font-weight:bold}#mermaid-svg-kwIdYePfSf2yisnx .taskText0,#mermaid-svg-kwIdYePfSf2yisnx .taskText1,#mermaid-svg-kwIdYePfSf2yisnx .taskText2,#mermaid-svg-kwIdYePfSf2yisnx .taskText3{fill:#fff}#mermaid-svg-kwIdYePfSf2yisnx .task0,#mermaid-svg-kwIdYePfSf2yisnx .task1,#mermaid-svg-kwIdYePfSf2yisnx .task2,#mermaid-svg-kwIdYePfSf2yisnx .task3{fill:#8a90dd;stroke:#534fbc}#mermaid-svg-kwIdYePfSf2yisnx .taskTextOutside0,#mermaid-svg-kwIdYePfSf2yisnx .taskTextOutside2{fill:#000}#mermaid-svg-kwIdYePfSf2yisnx .taskTextOutside1,#mermaid-svg-kwIdYePfSf2yisnx .taskTextOutside3{fill:#000}#mermaid-svg-kwIdYePfSf2yisnx .active0,#mermaid-svg-kwIdYePfSf2yisnx .active1,#mermaid-svg-kwIdYePfSf2yisnx .active2,#mermaid-svg-kwIdYePfSf2yisnx .active3{fill:#bfc7ff;stroke:#534fbc}#mermaid-svg-kwIdYePfSf2yisnx .activeText0,#mermaid-svg-kwIdYePfSf2yisnx .activeText1,#mermaid-svg-kwIdYePfSf2yisnx .activeText2,#mermaid-svg-kwIdYePfSf2yisnx .activeText3{fill:#000 !important}#mermaid-svg-kwIdYePfSf2yisnx .done0,#mermaid-svg-kwIdYePfSf2yisnx .done1,#mermaid-svg-kwIdYePfSf2yisnx .done2,#mermaid-svg-kwIdYePfSf2yisnx .done3{stroke:grey;fill:#d3d3d3;stroke-width:2}#mermaid-svg-kwIdYePfSf2yisnx .doneText0,#mermaid-svg-kwIdYePfSf2yisnx .doneText1,#mermaid-svg-kwIdYePfSf2yisnx .doneText2,#mermaid-svg-kwIdYePfSf2yisnx .doneText3{fill:#000 !important}#mermaid-svg-kwIdYePfSf2yisnx .crit0,#mermaid-svg-kwIdYePfSf2yisnx .crit1,#mermaid-svg-kwIdYePfSf2yisnx .crit2,#mermaid-svg-kwIdYePfSf2yisnx .crit3{stroke:#f88;fill:red;stroke-width:2}#mermaid-svg-kwIdYePfSf2yisnx .activeCrit0,#mermaid-svg-kwIdYePfSf2yisnx .activeCrit1,#mermaid-svg-kwIdYePfSf2yisnx .activeCrit2,#mermaid-svg-kwIdYePfSf2yisnx .activeCrit3{stroke:#f88;fill:#bfc7ff;stroke-width:2}#mermaid-svg-kwIdYePfSf2yisnx .doneCrit0,#mermaid-svg-kwIdYePfSf2yisnx .doneCrit1,#mermaid-svg-kwIdYePfSf2yisnx .doneCrit2,#mermaid-svg-kwIdYePfSf2yisnx .doneCrit3{stroke:#f88;fill:#d3d3d3;stroke-width:2;cursor:pointer;shape-rendering:crispEdges}#mermaid-svg-kwIdYePfSf2yisnx .milestone{transform:rotate(45deg) scale(0.8, 0.8)}#mermaid-svg-kwIdYePfSf2yisnx .milestoneText{font-style:italic}#mermaid-svg-kwIdYePfSf2yisnx .doneCritText0,#mermaid-svg-kwIdYePfSf2yisnx .doneCritText1,#mermaid-svg-kwIdYePfSf2yisnx .doneCritText2,#mermaid-svg-kwIdYePfSf2yisnx .doneCritText3{fill:#000 !important}#mermaid-svg-kwIdYePfSf2yisnx .activeCritText0,#mermaid-svg-kwIdYePfSf2yisnx .activeCritText1,#mermaid-svg-kwIdYePfSf2yisnx .activeCritText2,#mermaid-svg-kwIdYePfSf2yisnx .activeCritText3{fill:#000 !important}#mermaid-svg-kwIdYePfSf2yisnx .titleText{text-anchor:middle;font-size:18px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-kwIdYePfSf2yisnx g.classGroup text{fill:#9370db;stroke:none;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family);font-size:10px}#mermaid-svg-kwIdYePfSf2yisnx g.classGroup text .title{font-weight:bolder}#mermaid-svg-kwIdYePfSf2yisnx g.clickable{cursor:pointer}#mermaid-svg-kwIdYePfSf2yisnx g.classGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-kwIdYePfSf2yisnx g.classGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-kwIdYePfSf2yisnx .classLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.5}#mermaid-svg-kwIdYePfSf2yisnx .classLabel .label{fill:#9370db;font-size:10px}#mermaid-svg-kwIdYePfSf2yisnx .relation{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-kwIdYePfSf2yisnx .dashed-line{stroke-dasharray:3}#mermaid-svg-kwIdYePfSf2yisnx #compositionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-kwIdYePfSf2yisnx #compositionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-kwIdYePfSf2yisnx #aggregationStart{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-kwIdYePfSf2yisnx #aggregationEnd{fill:#ECECFF;stroke:#9370db;stroke-width:1}#mermaid-svg-kwIdYePfSf2yisnx #dependencyStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-kwIdYePfSf2yisnx #dependencyEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-kwIdYePfSf2yisnx #extensionStart{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-kwIdYePfSf2yisnx #extensionEnd{fill:#9370db;stroke:#9370db;stroke-width:1}#mermaid-svg-kwIdYePfSf2yisnx .commit-id,#mermaid-svg-kwIdYePfSf2yisnx .commit-msg,#mermaid-svg-kwIdYePfSf2yisnx .branch-label{fill:lightgrey;color:lightgrey;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-kwIdYePfSf2yisnx .pieTitleText{text-anchor:middle;font-size:25px;fill:#000;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-kwIdYePfSf2yisnx .slice{font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-kwIdYePfSf2yisnx g.stateGroup text{fill:#9370db;stroke:none;font-size:10px;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-kwIdYePfSf2yisnx g.stateGroup text{fill:#9370db;fill:#333;stroke:none;font-size:10px}#mermaid-svg-kwIdYePfSf2yisnx g.statediagram-cluster .cluster-label text{fill:#333}#mermaid-svg-kwIdYePfSf2yisnx g.stateGroup .state-title{font-weight:bolder;fill:#000}#mermaid-svg-kwIdYePfSf2yisnx g.stateGroup rect{fill:#ECECFF;stroke:#9370db}#mermaid-svg-kwIdYePfSf2yisnx g.stateGroup line{stroke:#9370db;stroke-width:1}#mermaid-svg-kwIdYePfSf2yisnx .transition{stroke:#9370db;stroke-width:1;fill:none}#mermaid-svg-kwIdYePfSf2yisnx .stateGroup .composit{fill:white;border-bottom:1px}#mermaid-svg-kwIdYePfSf2yisnx .stateGroup .alt-composit{fill:#e0e0e0;border-bottom:1px}#mermaid-svg-kwIdYePfSf2yisnx .state-note{stroke:#aa3;fill:#fff5ad}#mermaid-svg-kwIdYePfSf2yisnx .state-note text{fill:black;stroke:none;font-size:10px}#mermaid-svg-kwIdYePfSf2yisnx .stateLabel .box{stroke:none;stroke-width:0;fill:#ECECFF;opacity:0.7}#mermaid-svg-kwIdYePfSf2yisnx .edgeLabel text{fill:#333}#mermaid-svg-kwIdYePfSf2yisnx .stateLabel text{fill:#000;font-size:10px;font-weight:bold;font-family:'trebuchet ms', verdana, arial;font-family:var(--mermaid-font-family)}#mermaid-svg-kwIdYePfSf2yisnx .node circle.state-start{fill:black;stroke:black}#mermaid-svg-kwIdYePfSf2yisnx .node circle.state-end{fill:black;stroke:white;stroke-width:1.5}#mermaid-svg-kwIdYePfSf2yisnx #statediagram-barbEnd{fill:#9370db}#mermaid-svg-kwIdYePfSf2yisnx .statediagram-cluster rect{fill:#ECECFF;stroke:#9370db;stroke-width:1px}#mermaid-svg-kwIdYePfSf2yisnx .statediagram-cluster rect.outer{rx:5px;ry:5px}#mermaid-svg-kwIdYePfSf2yisnx .statediagram-state .divider{stroke:#9370db}#mermaid-svg-kwIdYePfSf2yisnx .statediagram-state .title-state{rx:5px;ry:5px}#mermaid-svg-kwIdYePfSf2yisnx .statediagram-cluster.statediagram-cluster .inner{fill:white}#mermaid-svg-kwIdYePfSf2yisnx .statediagram-cluster.statediagram-cluster-alt .inner{fill:#e0e0e0}#mermaid-svg-kwIdYePfSf2yisnx .statediagram-cluster .inner{rx:0;ry:0}#mermaid-svg-kwIdYePfSf2yisnx .statediagram-state rect.basic{rx:5px;ry:5px}#mermaid-svg-kwIdYePfSf2yisnx .statediagram-state rect.divider{stroke-dasharray:10,10;fill:#efefef}#mermaid-svg-kwIdYePfSf2yisnx .note-edge{stroke-dasharray:5}#mermaid-svg-kwIdYePfSf2yisnx .statediagram-note rect{fill:#fff5ad;stroke:#aa3;stroke-width:1px;rx:0;ry:0}:root{--mermaid-font-family: '"trebuchet ms", verdana, arial';--mermaid-font-family: "Comic Sans MS", "Comic Sans", cursive}#mermaid-svg-kwIdYePfSf2yisnx .error-icon{fill:#522}#mermaid-svg-kwIdYePfSf2yisnx .error-text{fill:#522;stroke:#522}#mermaid-svg-kwIdYePfSf2yisnx .edge-thickness-normal{stroke-width:2px}#mermaid-svg-kwIdYePfSf2yisnx .edge-thickness-thick{stroke-width:3.5px}#mermaid-svg-kwIdYePfSf2yisnx .edge-pattern-solid{stroke-dasharray:0}#mermaid-svg-kwIdYePfSf2yisnx .edge-pattern-dashed{stroke-dasharray:3}#mermaid-svg-kwIdYePfSf2yisnx .edge-pattern-dotted{stroke-dasharray:2}#mermaid-svg-kwIdYePfSf2yisnx .marker{fill:#333}#mermaid-svg-kwIdYePfSf2yisnx .marker.cross{stroke:#333}:root { --mermaid-font-family: "trebuchet ms", verdana, arial;}#mermaid-svg-kwIdYePfSf2yisnx {color: rgba(0, 0, 0, 0.75);font: ;}

捕鱼达人
欢迎界面
鱼类
鱼池类
网类

文件的大体

分步实现

首先需要一个程序启动的入口

我这里命名的是FishGame.java
这里面主要功能就是创建一个窗体,然后将需要的鱼类,网类,鱼池类加入其中

 final JFrame wel = new JFrame("欢迎界面");final WelcomePanel welcome = new WelcomePanel();wel.setSize(800, 480);wel.setLocationRelativeTo(null);wel.setResizable(false);wel.setUndecorated(true);wel.add(welcome);wel.setVisible(true);wel.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

以上是其中内容的一部分,完成在JFrame窗体中加入JPanel的欢迎面板。下面还有后续的加入鱼池等操作。

WelcomePanel.java类的作用

首先这个类继承了JPanel类,实现面板的基础功能,然后将这个面板加入JFrame窗体中。这里还有一个就是动态实现倒计时的功能。

public class WelcomePanel extends JPanel {BufferedImage image;int i = 4;public WelcomePanel(){try {image = ImageIO.read(new File("imgs/welcome.png"));} catch (IOException e) {// TODO Auto-generated catch blocke.printStackTrace();}}public void paint(Graphics g){i--;g.drawImage(image, 0, 0, null);Font font = new Font("宋体", Font.BOLD, 24);g.setFont(font);g.setColor(Color.YELLOW);g.drawString(i + "秒后,游戏开始", 350, 50);}
}

Fish.java

这里个是整个项目中最复杂的一个部分,这里的的每一条鱼都是一个线程,然后使用多线程技术完成鱼类的动态游动效果,鱼类的游动效果就是实现图片的快速加载,重画。

public Fish(String name) {try {for (int i = 0; i < imgs.length; i++) {imgs[i] = ImageIO.read(new File(name + "_0" + i + ".png"));}currentImg = imgs[0];width = currentImg.getWidth();height = currentImg.getHeight();index = 0;x = rand.nextInt(800 - width);y = rand.nextInt(480 - height);speed = rand.nextInt(10) + 2;} catch (IOException e) {e.printStackTrace();}}

以上是实现鱼类的构造方法,可以看到,就是完成多张图片的存储,其实化鱼类的位置和当前鱼类图片的大小。具体内容,见文末链接。

Pool.java

这个类的主要作用就是实现鱼类的加载,鱼类线程的启动,面板的重新绘制。

 public Pool() {//注册事件监听器//第一个this表示为pool添加事件监听器//第二个表示监听的对象为pool本身this.addMouseListener(this);this.addMouseMotionListener(this);try {bg = ImageIO.read(new File("imgs/bg.jpg"));}catch(IOException e) {e.printStackTrace();}power = 20;for(int i=0; i<9; i++) {fishes[i] = new Fish("imgs/fish0" + (i+1));fishes[i+11] = new Fish("imgs/fish0" + (i+1));}fishes[9] = new Fish("imgs/fish13");fishes[20] = new Fish("imgs/fish13");fishes[10] = new Fish("imgs/fish14");fishes[21] = new Fish("imgs/fish14");
//      for(int i=9; i<11; i++) {
//          fishes[i] = new Fish(i+4);
//          fishes[i+11] = new Fish(i+4);
//      }
//      fish = new Fish(13);}public void paint(Graphics g) {super.paint(g);g.drawImage(bg, 0, 0, null);
//      g.drawImage(fish.currentImg, fish.x, fish.y, null);for(int i=0; i<fishes.length; i++) {g.drawImage(fishes[i].currentImg, fishes[i].x, fishes[i].y, null);}if(net.show) {if(flag){g.drawImage(net.netImage, net.x - net.width/2, net.y - net.height/2, null);}else{g.drawImage(net.netImage, net.x - net.width/2/2, net.y - net.height/2/2, 80, 80, null);}}//绘制分数
//      Font font = new Font("宋体", Font.BOLD, 24);
//      g.setFont(font);
//      g.setColor(Color.WHITE);
//      g.drawString("分数: " + score, 350, 50);g.setColor(Color.YELLOW);Font font = new Font("宋体", Font.BOLD, 25);g.setFont(font);if(flag){g.drawString("当前网的状态:大网 ",0, 30);}else{g.drawString("当前网的状态:小网",0, 30);}g.setColor(Color.RED);g.drawString("当前体力值为:"+power, 400, 30);Font font1 = new Font("宋体", Font.BOLD, 15);g.setFont(font1);g.drawString("右击改变渔网大小", 0, 50);g.drawString("当前的条数为:"+fishCatched, 0, 70);g.drawString("得分为:" + score, 0, 90);}

这里只列举了其中主要实现的构造方法,和paint()方法的内容,具体内容见文末链接。

Net.java

这个模块应该是整个项目中比较简单的模块,完成网类的加载显示。其中最重要的一点就是捕鱼算法,这里算法的核心就是根据鱼类图片中心和网类图片中心点的距离与网图片宽度做对比来完成是抓到鱼的判断。

 public boolean catched(Fish f, boolean flag) {boolean result;int dx = Math.abs(this.x - f.x - f.width/2);int dy = Math.abs(this.y - f.y - f.height/2);int distance = (int)Math.sqrt(dx*dx + dy*dy);if(flag){result = distance < this.width/2 ? true : false;}else {result = distance < this.width/2/2 ? true : false;}return result;}

最后放上最后效果的照片


源码下载地址

基于java8的捕鱼达人小游戏相关推荐

  1. 基于c语言Easyx库的捕鱼达人小游戏

    基于c语言Easyx库的捕鱼达人小游戏(一) 文章目录 基于c语言Easyx库的捕鱼达人小游戏(一) 主菜单 游戏实现 捕鱼计分 下一阶段 主菜单 (写在前面的话:使用EASY-X库一定要命名为.cp ...

  2. H5 canvas基础入门到捕鱼达人小游戏实现(1)

    为什么学习canvas? 看见别人网页一些非常炫酷的效果,羡慕不已,于是对canvas产生了浓厚的兴趣,所以想仔细学习学习canvas.下面就一起来学习吧,本文为系列文章,最后会编写一个简单版的捕鱼达 ...

  3. 捕鱼达人小游戏——Java实现

    一.捕鱼达人小游戏,界面如下图: 二.有需要的代码自取: 链接:https://pan.baidu.com/s/1s5G2DwfSMlHoE4STanjKyw 提取码:evbg

  4. html实现经典捕鱼达人小游戏

    文章目录 1.设计来源 1.1 游戏界面 2.效果和源码 2.1 动态效果 2.2 源代码 源码下载 作者:xcLeigh 文章地址:https://blog.csdn.net/weixin_4315 ...

  5. Unity-3D捕鱼达人小游戏开发 —— 起因和开始的设置以及准备工作

    起因 假期里的软件实践课,使用Unity-3D写一个游戏,试想也不能太low,但是奈何素材和资源太难找,在论坛上逛到了捕鱼达人的素材,便来试一试 开始 素材毕竟是从网上扒的,我觉得也不好放出来,存在网 ...

  6. H5 canvas基础入门到捕鱼达人小游戏实现(3)-canvas运动入门,渐变,文字渲染,阴影

    上一篇主要讲解了矩形柱状图,弧形和饼图的绘制,但是离我们的目标还是有点远,不要紧,我们基础api都还没有学习完,今天继续. 本节主要内容 - canvas画板制作 - 块的直线运动 - 粒子运动 - ...

  7. java多线程捕鱼达人小游戏

    1.创建弹窗,并设置窗口属性. 2.创建Pool类,继承JPanel类,并重写paint方法. 3.创建Net类, 4.创建Fish类,继承Thread类,重写run方法. 5.刚开始先画一条鱼,一个 ...

  8. Java 实现 捕鱼达人 小游戏【附源码】

    博主介绍:

  9. Unity-3D捕鱼达人小游戏开发 —— 生成鱼

    在这16个位置生成鱼,也就是创建16个空项目来装出生点,设置锚点和坐标,尺寸合适 并且将所有出生点的红轴旋转指向地图 创建一个空项目然后挂脚本 MakeFish.cs public class Mak ...

最新文章

  1. 详解Silverlight Treeview的HierarchicalDataTemplate使用
  2. 干掉 powerdesigner,设计数据库表用它就够了
  3. 使用Elastic Job的namespace配置,防止任务名称的冲突
  4. android栈式存储,线性表数据结构解读(三)栈结构Stack
  5. 前端学习(2445):分页的实现
  6. Guava cache
  7. 俄国防部《红星电视台》公布一个俄军“监督”下的大型加密货币矿场
  8. [译] JAVA初学者的30个常见问题
  9. type=file的未选择任何文件修改_Electron应用易“招黑”,轻松被修改并植入后门...
  10. DbgView远程调试
  11. Ubuntu 训练深度学习模型的时候突然重启问题
  12. 积分形式的詹森不等式_詹森不等式
  13. 【DB笔试面试1-100】
  14. 网络访问:从网络访问此计算机属性增加guest组,workgroup无法访问,详细教您workgroup无法访问如何解决...
  15. Linux软件安装管理的三种方式——源码安装/deb/rpm/yum/apt
  16. 【转】为什么火线有电压,零线没有电压呢
  17. excel超链接应用:快速生成目录的几个方法-下
  18. SpringBoot系列:Spring Boot集成定时任务Quartz,java百度云短信发送
  19. 【RHCE】NFS服务器简介及简单共享目录配置
  20. 原始的ajaxtookit的使用

热门文章

  1. 《这些年,我们读过的技术经典图书》主题有奖征文【已结束】
  2. 10 个用图表解释JavaScript 闭包的面试题
  3. 前端中font的使用
  4. 这篇文章能让你明白卷积
  5. WindowsServer2012修改用户名后远程桌面连接失败
  6. 计算机 php 外文翻译,计算机外文翻译MySQL
  7. 计算机外文翻译旅游网站,外文翻译--旅游路线及管理系统(适用于毕业论文外文翻译+中英文对照).doc...
  8. 解决DPDK脚本python执行时“OSError: [Errno 2] No such file or directory”的问题
  9. ubuntu系统备份方法
  10. lambda python什么意思_python中lambda是指什么