|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--CellBasedGame.CellBasedGame
|
+--JBombGame
Classe che si occupa della gestione del gioco JBomb 1.2
| Field Summary | |
static int |
CELLHEIGHT
(costante) altezza delle celle |
static int |
CELLWIDTH
(costante) larghezza delle celle |
protected static int |
KEY_FIRE
costanti con le definizioni dei tasti |
protected static int |
KEY_PAUSE
costanti con le definizioni dei tasti |
protected static int |
KEY_SPECIAL
costanti con le definizioni dei tasti |
protected boolean |
m_bKeyFire
variabili booleana corrispondente allo stato del tasto della tastiera dell'azione corrispondente |
protected boolean |
m_bKeySpecial
variabili booleana corrispondente allo stato del tasto della tastiera dell'azione corrispondente |
private boolean |
m_bMustCreatLevel
true se bisogna ricostruire il livello |
private boolean |
m_bWinner
true se il giocatore ha vinto |
private java.util.LinkedList |
m_Monsters
LinkedList contenente i mostri di questo livello |
private int |
m_nBombs
numero di bombe del giocatore |
private int |
m_nFireLenght
lunghezza della fiamma del giocatore |
private int |
m_nKilledMonsters
numero dei mostri uccisi |
private int |
m_nLevel
numero del livello corrente |
private int |
m_nLife
numero di vite del giocatore |
private int |
m_nMonsters
numero mostri nel livello |
private int |
m_nScroll
coordinata per lo scrolling dei credits |
private int |
m_nScrollDir
direzione dello scrolling dei credits |
static int |
MAXWORLDHEIGHT
(costante) limiti massimi e minimi della dimensione del mondo |
static int |
MAXWORLDWIDTH
(costante) limiti massimi e minimi della dimensione del mondo |
static int |
MINWORLDHEIGHT
(costante) limiti massimi e minimi della dimensione del mondo |
static int |
MINWORLDWIDTH
(costante) limiti massimi e minimi della dimensione del mondo |
private JBPlayer |
Player
il giocatore |
| Fields inherited from class CellBasedGame.CellBasedGame |
m_BackGnd,
m_bGameOver,
m_bPaused,
m_CellWorld,
m_Container,
m_fParallaxFactor,
m_imgBackBuffer,
m_keybCtrl,
m_nCellHeight,
m_nCellWidth,
m_nMaxWorldHeight,
m_nMaxWorldWidth,
m_nOriginX,
m_nOriginY,
m_nPixelHeight,
m_nPixelWidth,
m_nWorldHeight,
m_nWorldOriginX,
m_nWorldOriginY,
m_nWorldWidth,
m_Sprites,
m_strPauseString,
m_timeCtrl |
| Constructor Summary | |
JBombGame(java.awt.Container p_Container,
java.awt.Image p_Sprites,
java.awt.Image p_BackGnd,
java.lang.String p_LevelCode)
Costruisce un nuovo oggetto JBombGame |
|
| Method Summary | |
protected void |
allocCellArray()
Alloca l'array di celle |
static int |
codeToNumber(java.lang.String p_LevelCode)
Traduce un codice livello in un numero |
private void |
createLevel(int nLvlNumber)
Crea i dati per un dato livello. |
private void |
createMonster(int nMonsterLevel,
int idx)
Crea un mostro nuovo |
void |
decreaseBombCount()
Decrementa il pool di bombe del giocatore |
void |
decreaseMonsterCount()
aumenta di uno il conteggio dei mostri uccisi e gestisce le condizioni di fine livello e vittoria finale |
protected void |
eachFrame()
Esegue le azioni da fare ogni iterazione Ricostruisce il livello se necessario, esegue i vari timeTick, muove tutti i mostri, il giocatore e aggiorna le coordinate del viewport |
protected void |
eachPausedFrame()
Esegue uno sleep maggiore quando non serve tutto questo carico sulla CPU |
void |
gameOver()
Sottrae una vita dal conteggio del giocatore e se necessario dà gameover |
Explodable[][] |
getExplodableArray()
Restituisce un array di oggetti Explodable |
JBPlayer |
getPlayer()
Restituisce il JBPlayer correntemente attivo |
void |
increaseBombCount()
Incrementa il pool di bombe del giocatore |
void |
increaseFireLenght()
Aumenta la gittata delle bombe |
void |
increaseLifeCount()
Aumenta le vite a disposizione del giocatore |
static java.lang.String |
numberToCode(int i)
traduce un numero di livello in un levelcode |
protected void |
paintCustom(java.awt.Graphics gfx)
Ridisegna il giocatore e i vari mostri Se il gioco è in gameOver disegna dei crediti. |
protected void |
paintStatus(java.awt.Graphics gfx)
Ridisegna la status bar con informazioni sul gioco |
void |
updateKeyState(java.awt.event.KeyEvent e,
boolean pressed)
Riceve una notifica di cambiamento di stato della tastiera. |
| Methods inherited from class CellBasedGame.CellBasedGame |
changeCell,
dispose,
drawSprite,
getCell,
getCellHeight,
getCellWidth,
getWorldHeight,
getWorldWidth,
paint,
paintBackGnd,
pause,
pixelToCell,
setOrigin,
setWorldOrigin,
stopTimeCtrl,
timeTick |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int MAXWORLDWIDTH
public static final int MAXWORLDHEIGHT
public static final int MINWORLDWIDTH
public static final int MINWORLDHEIGHT
public static final int CELLWIDTH
public static final int CELLHEIGHT
protected static final int KEY_FIRE
protected static final int KEY_SPECIAL
protected static final int KEY_PAUSE
protected boolean m_bKeyFire
protected boolean m_bKeySpecial
private int m_nMonsters
private JBPlayer Player
private int m_nLife
private int m_nBombs
private int m_nLevel
private boolean m_bMustCreatLevel
private java.util.LinkedList m_Monsters
private int m_nKilledMonsters
private int m_nFireLenght
private boolean m_bWinner
private int m_nScroll
private int m_nScrollDir
| Constructor Detail |
public JBombGame(java.awt.Container p_Container,
java.awt.Image p_Sprites,
java.awt.Image p_BackGnd,
java.lang.String p_LevelCode)
p_Container - Il Container su cui disegnare il giocop_Sprites - Un Image in cui è stato caricato il contenuto di "Sprites.gif"p_BackGnd - Un Image in cui è stato caricato il contenuto di "Grass.jpg"p_LevelCode - Una stringa, contenente il codice del livello. Se non valida, si parte dal primo livello.| Method Detail |
public static int codeToNumber(java.lang.String p_LevelCode)
p_LevelCode - Il codice del livellopublic static java.lang.String numberToCode(int i)
i - Numero di livelloprotected void allocCellArray()
protected void eachFrame()
protected void eachPausedFrame()
protected void paintCustom(java.awt.Graphics gfx)
protected void paintStatus(java.awt.Graphics gfx)
private void createLevel(int nLvlNumber)
nLvlNumber - Numero del livello da creare
public void updateKeyState(java.awt.event.KeyEvent e,
boolean pressed)
public JBPlayer getPlayer()
public Explodable[][] getExplodableArray()
public void gameOver()
public void increaseBombCount()
public void decreaseBombCount()
private void createMonster(int nMonsterLevel,
int idx)
nMonsterLevel - livello di potenza del mostroidx - Parametro deprecato che veniva utilizzato come indice quando al posto di una LinkedList si usava un array dinamicopublic void decreaseMonsterCount()
public void increaseFireLenght()
public void increaseLifeCount()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||