food.java
来自「用Java做的小游戏:Pacman 和小时候玩的吃豆豆一样」· Java 代码 · 共 29 行
JAVA
29 行
import java.util.*;import java.awt.*;import gaming.*;import java.lang.Object;public class Food extends DummyItem{ public Food(int x,int y) { super(x,y,Color.pink,0); //the normal food which color is pink it is a small dot } public Food(int x,int y, Color myColor,int shape) { super(x,y,Color.red,1);//the super food which color is red and it is a bigger dot } public int getX() { return x; } public int getY() { return y; } public Color getColor() { return this.color; } public int getShape() { return this.shape; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?