stringtools.java
来自「JAVA ME手机游戏FLY,玩家操控飞机」· Java 代码 · 共 48 行
JAVA
48 行
/** /??
字符显示类?/ */
public class StringTools {
/** /?? 定义数字 ?/ */
private static final int N10 = 10;
/** /?? 定义数字 ?/ */
private static final int N16 = 16;
/** /?? 定义数字 ?/ */
private static final int N20 = 20;
/** /?? 定义数字 ?/ */
private static final int N25 = 25;
/** /?? 定义数字 ?/ */
private static final int N30 = 30;
/** /?? 定义数字 ?/ */
private static final int N40 = 40;/** /?? 构造函数 ?/ */ protected StringTools() { }
/** /?? 控制字符显示
?@param gameTime
?@return result ?/ */
protected static String checkTime(final long gameTime) {
String result = null;
if (gameTime <= N10) {
result = "Do you play with your foot?";
}
if (N10 < gameTime && gameTime <= N16) {
result = "come boy,you can do it!";
}
if (N16 < gameTime && gameTime <= N20) {
result = "what a pity!try again.";
}
if (N20 < gameTime && gameTime <= N25) {
result = "very well,you are a real man.";
}
if (N25 < gameTime && gameTime <= N30) {
result = "i know you have talent of this game.";
}
if (N30 < gameTime && gameTime <= N40) {
result = "i can't belive,you are a game master.";
}
if (gameTime > N40) {
result = "oh my god, are you a human?";
}
return result;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?