?? fastfuriousmidlet.java
字號:
// FrontEnd Plus GUI for JAD
// DeCompiled : FastFuriousMIDlet.class
import java.io.PrintStream;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
public class FastFuriousMIDlet extends MIDlet
{
private final Menu me = new Menu(this);
public final Testo te = new Testo();
boolean vibra;
boolean sound;
public GameManager gM;
private MenuOpzioni mO;
private MenuLivelli mL;
int livello;
long tempo;
long mtempo;
boolean vinto;
private boolean gC;
int li;
public FastFuriousMIDlet()
{
gM = null;
mO = null;
mL = null;
gC = false;
Database db = new Database();
livello = db.leggiLivello();
vibra = db.getUseVibration();
vibra = db.getUseSound();
db = null;
System.gc();
}
public void startApp()
{
Displayable cu = Display.getDisplay(this).getCurrent();
if(cu == null)
{
Presentazione pr = new Presentazione(this, me);
Display.getDisplay(this).setCurrent(pr);
pr.start();
} else
{
Display.getDisplay(this).setCurrent(cu);
if(gM != null && cu == gM.getCanvas())
gM.resume();
}
}
public void pauseApp()
{
if(gM != null)
gM.pause();
Display.getDisplay(this).setCurrent(gM.getCanvas());
}
public void destroyApp(boolean un)
{
if(gM != null)
gM.stop();
}
void gameManagerMainMenu(boolean isGO)
{
if(isGO)
{
me.deleteContinue();
assegnaPunteggio();
} else
{
me.selectContinue();
}
Display.getDisplay(this).setCurrent(me);
}
void mainMenuContinua()
{
Display.getDisplay(this).setCurrent(gM.getCanvas());
}
void mainMenuNuovaPartita()
{
mO = null;
mL = null;
System.gc();
javax.microedition.lcdui.Canvas clCa = new NokiaCloseableCanvas();
if(gC)
{
gM.resetta();
Display.getDisplay(this).setCurrent(gM.getCanvas());
} else
{
gM = new GameManager(this, clCa);
((SettableDelegate)clCa).setDelegate(gM);
gM.start();
Display.getDisplay(this).setCurrent(clCa);
me.addContinue();
gC = true;
}
}
void mainMenuOpzioni()
{
if(mO == null)
mO = new MenuOpzioni(this, me);
Display.getDisplay(this).setCurrent(mO);
}
void mainMenuRecords()
{
String ti = "Records";
String ba = "Indietro";
String pp = null;
String te = "Livello Facile\n" + leggiPunteggio(0) + "\n" + "Livello Normale\n" + leggiPunteggio(1) + "\n" + "Livello Difficile\n" + leggiPunteggio(2);
MenuTesto is = new MenuTesto(this, ti, te, ba);
Display.getDisplay(this).setCurrent(is);
}
void mainMenuIstruzioni()
{
String ti = "Istruzioni";
String ba = "Indietro";
String te = "Controlli\n\n2/UP - accelera\n4 - vai a sx\n6 - vai a dx\n8/DOWN - frena\n1/LEFT - accelera e vai a sx\n3/RIGHT - accelera e vai a dx\n5 - nitro\n\nScegli la tua auto sportiva preferita tra le 4 disponibili e sfida il computer in una veloce e furiosa gara a due per le strade della citt\340.\nIl tuo obiettivo \350 raggiungere il traguardo prima dell'avversario.\nTutte le auto di 2Fast2Furious hanno la nitro, un composto che, aggiunto al carburante, aumenta considerevolmente la velocit\340 della macchina.\nPuoi attivare la nitro solo dopo aver raggiunto la velocit\340 di 120 Km/h, ma fai attenzione... la nitro va usata con moderazione, perch\350 quando \350 attiva aumenta notevolmente il consumo di carburante, indicato dalla barra \"FUEL\". Quando il carburante si esaurisce la gara \350 persa. La nitro viene disattivata quando si frena oppure quando si verifica uno scontro.\nE proprio gli scontri rappresentano un'altra delle caratteristiche principali di 2Fast2Furious. Il percorso di gara \350 una strada cittadina percorsa da altre vetture che dovrai superare evitando di toccarle, altrimenti la tua auto non solo rallenter\340 la velocit\340 di corsa, ma subir\340 dei danni, segnalati dalla barra \"DAMAGE\". Quando il livello dei danni raggiunge lo zero la gara \350 persa.\n\nI livelli di difficolt\340 sono 3 (facile, normale e difficile), selezionabili all'interno della schermata Livello.\nNella schermata Records vengono registrate le tue statische di gara e il miglior tempo.\n\n";
MenuTesto is = new MenuTesto(this, ti, te, ba);
Display.getDisplay(this).setCurrent(is);
}
void mainMenuLivelli()
{
if(mL == null)
mL = new MenuLivelli(this, me);
Display.getDisplay(this).setCurrent(mL);
}
void mainMenuCrediti()
{
String ab = "2fast2furious\nVersione: 1.0.0\n\nB-Rush Entertainment\nMCSoftware2000\nXister\n\nGame Design:\n Rosario Basilotta\n\nGame Programming:\n Mauro Ciucciarelli\n\nGraphics:\n Filippo Grossi\n";
String ti = "Credits";
String ba = "Indietro";
MenuTesto cr = new MenuTesto(this, ti, ab, ba);
Display.getDisplay(this).setCurrent(cr);
}
void mainMenuExit()
{
destroyApp(false);
notifyDestroyed();
}
void settingEditorSave(String na, boolean iO)
{
if(na.equals("Vibrazione"))
{
Database database = new Database();
database.setUseVibration(iO);
mO.setUseVibration(iO);
database = null;
System.gc();
}
Alert con = new Alert(null, na + " " + mO.onOffString(iO), null, AlertType.CONFIRMATION);
con.setTimeout(4000);
Display.getDisplay(this).setCurrent(con, mO);
}
void assegnaLivello(String lS, int li)
{
Database database = new Database();
database.assegnaLivello(li);
database = null;
System.gc();
livello = li;
mL.assegnaLivello(li);
}
void settingEditorBack()
{
Display.getDisplay(this).setCurrent(mO);
}
void settingsScreenBack(Displayable la)
{
mO = null;
if(gM != null && la == gM.getCanvas())
gM.resume();
Display.getDisplay(this).setCurrent(la);
}
void settingsScreenEdit(String na, boolean iO)
{
Display.getDisplay(this).setCurrent(new OnOffMenu(this, na, iO));
}
void splashScreenDone(Displayable ne)
{
Display.getDisplay(this).setCurrent(ne);
}
void textScreenClosed()
{
Display.getDisplay(this).setCurrent(me);
}
void assegnaPunteggio()
{
String pp = null;
Database database = new Database();
database.assegnaLivello(li);
try
{
pp = database.leggiPunteggio(livello);
}
catch(Exception e)
{
System.err.println(e);
}
int i = pp.indexOf(46);
long t = 0L;
int i2 = pp.indexOf(46, i + 1);
int v = 0;
int p = 0;
try
{
t = Integer.parseInt(pp.substring(0, i));
v = Integer.parseInt(pp.substring(i + 1, i2));
p = Integer.parseInt(pp.substring(i2 + 1, pp.length()));
}
catch(Exception e) { }
if(vinto)
v++;
else
p++;
if(mtempo != -1L)
if(t != 0L && mtempo < t)
t = mtempo;
else
if(t == 0L)
t = mtempo;
try
{
database.assegnaPunteggio(livello, t + "." + v + "." + p);
}
catch(Exception e) { }
database = null;
System.gc();
}
String leggiPunteggio(int l)
{
String pp = null;
Database database = new Database();
try
{
pp = database.leggiPunteggio(l);
}
catch(Exception e)
{
System.err.println(e);
}
int i = pp.indexOf(46);
long t = 0L;
int i2 = pp.indexOf(46, i + 1);
int v = 0;
int p = 0;
try
{
t = Integer.parseInt(pp.substring(0, i));
v = Integer.parseInt(pp.substring(i + 1, i2));
p = Integer.parseInt(pp.substring(i2 + 1, pp.length()));
}
catch(Exception e) { }
database = null;
System.gc();
return "Vinte: " + v + "\n" + "Perse: " + p + "\n" + "Miglior\n Tempo: " + ct(t) + "\n";
}
String ct(long t)
{
tempo = t;
long m = t / 60000L;
long s = (t - m * 60000L) / 1000L;
long ml = (t - m * 60000L - s * 1000L) / 10L;
String mlS;
if(ml < 10L)
mlS = "0" + ml;
else
mlS = "" + ml;
String sS;
if(s < 10L)
sS = "0" + s;
else
sS = "" + s;
return "" + m + "." + sS + "." + mlS;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -