📄 spark.java
字号:
// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3)
// Source File Name: Spark.java
package matchit2;
import javax.microedition.lcdui.Graphics;
// Referenced classes of package matchit2:
// ListItem
class Spark extends ListItem
{
Spark(int x, int y, int vx, int vy, int colour, int ticksToLive)
{
this.x = x;
this.y = y;
oldX = x;
oldY = y;
this.vx = vx;
this.vy = vy;
this.colour = colour;
this.ticksToLive = ticksToLive;
}
void tick()
{
if(--ticksToLive <= 0)
{
remove();
} else
{
oldX = x;
oldY = y;
x += vx;
y += vy;
vx -= vx * 25 >> 8;
vy -= vy * 25 >> 8;
vy += 25;
}
}
void draw(Graphics g)
{
g.setColor(colour);
g.drawLine(x >> 8, y >> 8, oldX >> 8, oldY >> 8);
}
private static final int DRAG_FACTOR = 25;
private static final int GRAVITATIONAL_ACCELERATION = 25;
private int x;
private int y;
private int oldX;
private int oldY;
private int vx;
private int vy;
private final int colour;
private int ticksToLive;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -