📄 spritebackground.java
字号:
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
// Referenced classes of package ys.pingu:
// PinguSprite, PinguMIDlet, PinguCanvas
class SpriteBackground extends PinguSprite
{
public boolean valid;
private static final int ANCHOR_IMG = 20;
private Image bg0;
private Image bg1;
public SpriteBackground(int i, int j, int k)
{
super(i, j, k);
bg0 = PinguMIDlet.loadImage("/bg0.png");
bg1 = PinguMIDlet.loadImage("/bg1.png");
if(bg0 == null || bg1 == null)
valid = false;
else
valid = true;
}
public void init()
{
spriteInit();
}
public void draw()
{
accelerate(1);
move(1);
if(PinguCanvas.GAMESTATE == 5)
parked = true;
PinguCanvas.GC.setColor(0);
PinguCanvas.GC.drawImage(bg0, 0, 0, 20);
if((actPos_x * 333) / 1000 < 130)
PinguCanvas.GC.drawImage(bg1, (actPos_x * 333) / 1000 + 40, actPos_y + 32, 20);
//PinguCanvas.GC.drawImage(bg1, (actPos_x * 333) / 1000 , actPos_y + 32, 20);
}
public void setVelocity(int i)
{
velocity_x = -1 * i;
parked = false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -