📄 gameoverscreen.jad
字号:
// Decompiled by DJ v2.9.9.60 Copyright 2000 Atanas Neshkov Date: 2005-9-4 14:18:31
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: GameOverScreen.java
import javax.microedition.lcdui.*;
class GameOverScreen extends Canvas
{
GameOverScreen(escapeeMIDlet midlet, long time, int BULLETS_NUM)
{
this.midlet = midlet;
this.time = time;
this.BULLETS_NUM = BULLETS_NUM;
setFullScreenMode(true);
if(midlet.checkBestTime(time))
{
wasBestTime = true;
bestTime = time;
SoundEffects.getInstance().startHighScoreSound();
midlet.vibrate(1000);
} else
{
wasBestTime = false;
bestTime = midlet.getBestTime();
SoundEffects.getInstance().startGameOverSound();
}
midlet.flashBacklight(1000);
}
public void paint(Graphics g)
{
int CanvasWidth = getWidth();
int CanvasHeight = getHeight();
g.setColor(245, 130, 35);
g.fillRect(0, 0, CanvasWidth, CanvasHeight);
g.setFont(Font.getFont(64, 1, 16));
int centerX = CanvasWidth / 2;
int centerY = CanvasHeight / 2;
g.setColor(0xffffff);
drawText(g, centerX, centerY - 1);
drawText(g, centerX, centerY + 1);
drawText(g, centerX - 1, centerY);
drawText(g, centerX + 1, centerY);
g.setColor(0);
drawText(g, centerX, centerY);
}
private void drawText(Graphics g, int centerX, int centerY)
{
int fontHeight = g.getFont().getHeight();
int textHeight = 4 * fontHeight;
int topY = centerY - textHeight / 2;
float Time_Second = (float)time / 1000F;
float BestTime_Second = (float)bestTime / 1000F;
g.drawString("GAME OVER", centerX, topY, 17);
g.drawString("\u65F6\u95F4: " + Time_Second + "s", centerX, topY + fontHeight, 17);
g.drawString("\u5B50\u5F39\uFF1A" + BULLETS_NUM + "\u53D1", centerX, topY + 2 * fontHeight, 17);
g.drawString(wasBestTime ? "\u8FD9\u662F\u76EE\u524D\u6700\u597D\u8BB0\u5F55!" : "\u6700\u957F\u65F6\u95F4: " + BestTime_Second + "s", centerX, topY + 3 * fontHeight, 17);
}
public void keyPressed(int keyCode)
{
midlet.gameOverDone();
}
private final escapeeMIDlet midlet;
private boolean wasBestTime;
private long time;
private long bestTime;
private int BULLETS_NUM;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -