?? game.java
字號:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Game extends MIDlet
{
private Display display;
public static CarStore cs = new CarStore();
public StartForm form;
public GarageClient garage;
public void startApp()
{
// To begin, read values from storage
if (!cs.readStore())
{
// If we have problem use default values....
cs.setCash(100);
Weapon[] weapons = new Weapon[2];
weapons[0] = new Weapon(Weapon.FLAME, 5,7,"Flame Thrower","Toasts Cars In Front");
weapons[1] = new Weapon(Weapon.OIL, 15,2,"Oil Slick","Makes Cars Slide");
cs.setWeapons(weapons);
}
// Be sure we have at least SOME ammo
for (int i=0; i < cs.getWeapons().length; i++)
{
if (cs.getWeapons()[i] != null && cs.getWeapons()[i].getWeaponAmmo() <= 0)
cs.getWeapons()[i].setWeaponAmmo(10);
}
garage = new GarageClient(this);
display = Display.getDisplay(this);
form = new StartForm(this);
display.setCurrent(form);
}
public void pauseApp() {}
public void destroyApp(boolean b)
{
System.out.println("DestroyApp() called. Writing data to RecordStore");
cs.writeToStore();
}
public Display getDisplay()
{
return display;
}
public void exit()
{
destroyApp(false);
notifyDestroyed();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -