gamepanel.java
来自「培训老师写的nb代码,midp1.0画出来的游戏」· Java 代码 · 共 31 行
JAVA
31 行
import javax.microedition.lcdui.Graphics;
public class GamePanel
{
public static final int WIDTH = 12;
public static final int HEIGHT = 15;
private final int SCREEN_WIDTH = 240;
private final int SCREEN_HEIGHT = 291;
private Shape shape;
private Ground ground;
private void paint(Graphics g)
{
System.out.println("paint...");
g.setColor(0x808080);
g.fillRect(0,0,SCREEN_WIDTH,SCREEN_HEIGHT);
shape.paint(g);
ground.paint(g);
}
public void display(Graphics g, Shape shape, Ground ground)
{
if(shape != null && ground != null)
{
this.shape = shape;
this.ground = ground;
paint(g);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?