• 大小: 59KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-02
  • 语言: Java
  • 标签: flappy  bird  扑扇鸟  

资源简介

《扑扇的小鸟》是一款像素风格的休闲游戏,玩家只需要点击屏幕就可以操作游戏,控制角色通过各种障碍,游戏难度非常大。

资源截图

代码片段和文件信息

package com.angsi.demo;

import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.image.ImageObserver;

public class Bg {

private int width;

private int height;

private Image bgframe[];

private int x1;

private int x2;

private int y = 0;

private int speed = 2;

public Bg(int width int height){

bgframe = new Image[2];

bgframe[0] = Toolkit.getDefaultToolkit().getImage(“res/bg.png“);
bgframe[1] = Toolkit.getDefaultToolkit().getImage(“res/bg.png“);

this.width = width;

this.height = height;

x1 = 0;

x2 = x1 + width;
}

public void draw(Graphics2D g2d ImageObserver observer){

 g2d.drawImage(bgframe[0] x1 y width height observer);
 g2d.drawImage(bgframe[1] x2 y width height observer);
}

public void logic(){

x1-=speed;
x2-=speed;

if(x2 == 0){

x1 = x2+width;
}

if(x1 == 0){
x2 = x1 + width;
}


}



}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-08-22 16:20  FlyBird\
     文件         302  2018-08-22 16:08  FlyBird\.classpath
     文件         383  2018-08-22 16:08  FlyBird\.project
     目录           0  2018-08-22 16:08  FlyBird\.settings\
     文件         598  2018-08-22 16:08  FlyBird\.settings\org.eclipse.jdt.core.prefs
     目录           0  2018-08-22 16:08  FlyBird\bin\
     目录           0  2018-08-22 16:08  FlyBird\bin\com\
     目录           0  2018-08-22 16:08  FlyBird\bin\com\angsi\
     目录           0  2018-08-22 17:33  FlyBird\bin\com\angsi\demo\
     文件        1333  2018-08-22 18:03  FlyBird\bin\com\angsi\demo\Bg.class
     文件        2837  2018-08-22 18:03  FlyBird\bin\com\angsi\demo\Bird.class
     文件        1115  2018-08-22 17:29  FlyBird\bin\com\angsi\demo\Birdframe.class
     文件         420  2018-08-22 17:41  FlyBird\bin\com\angsi\demo\GlobalUtil.class
     文件         430  2018-08-22 16:12  FlyBird\bin\com\angsi\demo\Main.class
     文件        3879  2018-08-22 18:00  FlyBird\bin\com\angsi\demo\MainGame.class
     文件        2402  2018-08-22 18:04  FlyBird\bin\com\angsi\demo\Pipe.class
     文件        1780  2018-08-22 17:54  FlyBird\bin\com\angsi\demo\Score.class
     目录           0  2018-08-22 17:33  FlyBird\res\
     文件       24946  2018-08-22 14:35  FlyBird\res\bg.png
     文件         786  2018-08-22 14:35  FlyBird\res\bird1.png
     文件         766  2018-08-22 14:35  FlyBird\res\bird2.png
     文件         790  2018-08-22 14:35  FlyBird\res\bird3.png
     文件        1931  2018-08-22 14:35  FlyBird\res\land.png
     文件       22037  2018-08-22 14:35  FlyBird\res\pipe_down.png
     文件       22234  2018-08-22 14:35  FlyBird\res\pipe_up.png
     文件         508  2018-08-22 14:35  FlyBird\res\score0.png
     文件         453  2018-08-22 14:35  FlyBird\res\score1.png
     文件         432  2018-08-22 14:35  FlyBird\res\score2.png
     文件         432  2018-08-22 14:35  FlyBird\res\score3.png
     文件         533  2018-08-22 14:35  FlyBird\res\score4.png
     文件         432  2018-08-22 14:35  FlyBird\res\score5.png
............此处省略16个文件信息

评论

共有 条评论