?? pingusprite.java
字號(hào):
class PinguSprite
{
protected int velocity_x;
protected int velocity_y;
protected int acceleration_x;
protected int acceleration_y;
protected int actPos_x;
protected int actPos_y;
protected boolean parked;
protected int baseline;
private int xOrg;
private int yOrg;
protected PinguSprite(int i, int j, int k)
{
velocity_x = 0;
velocity_y = 0;
acceleration_x = 0;
acceleration_y = 0;
actPos_x = 0;
actPos_y = 0;
parked = true;
xOrg = i;
yOrg = j;
baseline = k;
spriteInit();
}
protected void spriteInit()
{
parked = true;
velocity_x = 0;
velocity_y = 0;
acceleration_x = 0;
acceleration_y = 0;
actPos_x = xOrg;
actPos_y = yOrg;
}
protected void move(int i)
{
if(!parked)
{
actPos_x += velocity_x / 1000;
actPos_y += velocity_y / 1000;
if(actPos_y > baseline)
actPos_y = baseline;
}
}
protected void accelerate(int i)
{
if(!parked)
{
velocity_x += acceleration_x;
velocity_y += acceleration_y;
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -