• 大小: 105KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-29
  • 语言: Java
  • 标签: jav    

资源简介

本游戏为使用鼠标瞄准鸟,点击鸟图片对其进行射击,底部的炮台会随着鼠标的移动而移动,适合初学者以及需要完成作业者

资源截图

代码片段和文件信息

package shootBird;


import java.awt.Graphics;
import java.awt.Image;
import java.math.*;

public class Bird extends Gameobject {

boolean live = true;
public void drawMySelf(Graphics g) {
if(live) {
super.drawMySelf(g);
this.x = this.x + this.speed;
}

}

public Bird(Image img double x double y) {
super(img x y);
}

public Bird(Image img) {
int side = (int)(Math.random()*10);//小于5 出现在左边,如果大于5则出现在右边
if(side<5) {
this.x = 0;
this.speed = (int)(Math.random()*2)+1;
}
if(side>5) {
this.x = 900;
this.speed = -(int)(Math.random()*2)-1;
}
System.out.println(this.speed);

this.y = (int)(Math.random()*300);
this.img = img;
if(img != null) {
this.width = img.getWidth(null);
this.height = img.getHeight(null);
}
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        397  2018-12-19 11:09  shootBird\.classpath

     文件         30  2018-12-26 21:58  shootBird\.git\COMMIT_EDITMSG

     文件        288  2018-12-23 14:25  shootBird\.git\config

     文件         23  2018-12-23 13:54  shootBird\.git\HEAD

     文件       1000  2018-12-26 21:57  shootBird\.git\index

     文件       1325  2018-12-26 21:58  shootBird\.git\logs\HEAD

     文件       1325  2018-12-26 21:58  shootBird\.git\logs\refs\heads\master

     文件        709  2018-12-24 00:16  shootBird\.git\logs\refs\remotes\origin\master

     文件        183  2018-12-23 17:23  shootBird\.git\objects\06\0ec3345c7d5096a727f38de40e54ceceb3a2bf

     文件         82  2018-12-23 17:22  shootBird\.git\objects\09\79851dc2f54fa3e912502795ec5632c270c019

     文件        208  2018-12-23 15:24  shootBird\.git\objects\11\66d6d4e9ff6d1aa43178873a0a892b703fffb2

     文件        183  2018-12-23 17:22  shootBird\.git\objects\15\4e42b8650c9d4705429f6981105d19084da036

     文件        432  2018-12-26 21:57  shootBird\.git\objects\27\1c5aa3b377a5acfe8745172d699c34aa9e10d5

     文件        152  2018-12-23 15:24  shootBird\.git\objects\2e\8466d2c90a19012ea1fd0e957747042d719e67

     文件         52  2018-12-23 17:21  shootBird\.git\objects\2e\e6faae409235ad3a342f704224078ff7b8b8c4

     文件        212  2018-12-23 14:09  shootBird\.git\objects\2e\eb2bbeb1d7457a5971989d5932319457e0226c

     文件        519  2018-12-24 00:15  shootBird\.git\objects\2f\803a08856a0ffeb325bcdd3a2eec88a084e3ab

     文件        903  2018-12-26 21:57  shootBird\.git\objects\34\ed7762c03a688a0d5c652bc75d45d1fc2c5e93

     文件        168  2018-12-23 17:22  shootBird\.git\objects\39\d406ddc4b0095cc28e4fe7fa9560ecbafb7564

     文件        138  2018-12-23 14:24  shootBird\.git\objects\3c\5256a113899d01d81a56a53a37e128e00b4e83

     文件        460  2018-12-26 21:57  shootBird\.git\objects\44\fd081b5360ad3f139d9a3d9fdea0804c7989ff

     文件       2708  2018-12-24 00:16  shootBird\.git\objects\47\4ba22b2f349f49fd075329457fd0ef2d18df85

     文件         51  2018-12-23 17:22  shootBird\.git\objects\50\89167d43f8386eceaaff4db067ba9815380519

     文件        183  2018-12-26 21:58  shootBird\.git\objects\58\7d375fcc21a4acf1f48735f81d2dd4f09dbb99

     文件         51  2018-12-23 14:09  shootBird\.git\objects\58\aeb0b4d5056e37cb594fba10384536952ff45d

     文件        430  2018-12-24 00:15  shootBird\.git\objects\5b\0132e5cb9cd9f5675122a5bcefe4d9e52bf419

     文件        727  2018-12-23 14:09  shootBird\.git\objects\5b\3f7d11ec4acd2dc4c3b739af30173366ae5a3f

     文件        408  2018-12-23 17:21  shootBird\.git\objects\5b\468fd6f6f23a4458514302551428689035969d

     文件        201  2018-12-26 21:58  shootBird\.git\objects\5c\2d9e6f5c5d01d748a67bf46ee1714644679b38

     文件        183  2018-12-23 17:21  shootBird\.git\objects\61\ab478f6f927d4b14a58d9b8be523c4cfa6e919

............此处省略130个文件信息

评论

共有 条评论