diff --git a/Ground.java b/Ground.java new file mode 100644 index 0000000..7bb223f --- /dev/null +++ b/Ground.java @@ -0,0 +1,25 @@ +package com; + +import java.awt.image.BufferedImage; + +public class Ground { + int x, y; + int width, height; + BufferedImage img_ground; // 地面图片 + + public Ground() { + img_ground = BirdGame.ground; + x = 0; + y = BirdGame.bg.getHeight() - img_ground.getHeight(); + width = img_ground.getWidth(); + height = img_ground.getHeight(); + } + + // 地面移动 + public void step() { + x = x - 1; + if (x <= 432 - width) { + x = 0; + } + } +}