Class MadnessMIDlet

java.lang.Object
  |
  +--javax.microedition.midlet.MIDlet
        |
        +--MadnessMIDlet
All Implemented Interfaces:
java.lang.Runnable

public class MadnessMIDlet
extends javax.microedition.midlet.MIDlet
implements java.lang.Runnable

Class MadnessMIDlet is the super class. it handels the display mainly switching between the menus and the game. it handles the required events specfic for apllication deployment to a mobile handset. it handels any loading of files in the res folder and the recordstore

Title: Monkey Madness

Description: Player must run arround field, destroying and avoiding bombs, droids and boss.

Copyright: Copyright (c) 2005

Company: Pistachio Monkey


Field Summary
 BluetoothHandle btHandle
           
 int level
           
 int levelDroids
           
 int lives
           
 int points
           
 int wallNumber
           
 
Constructor Summary
MadnessMIDlet()
          Holds no constructors
 
Method Summary
 void bluetoothClient()
          sets the handset to act as the Client of a bluetooth game
 void bluetoothHost()
          sets the handset to act as the Host of a bluetooth game
 boolean checkHighScore()
          checks to see if the current score is high, if so, it writes it to the record store and returns true
 void destroyApp(boolean unconditional)
          calls a stop to the levelCanvas
 void gameOver()
          refreshes the game stats & creates an instance of the GameOverScreen class
 void gameOverDone()
          returns the display back to the MenuList and calls stopMusic()
 BluetoothHandle getBluetooth()
          returns the BluetoothHandle
 LevelCanvas getCanvas()
          returns the LevelCanvas
 int getHighScore()
          returns an int of the highest score
 void levelCanvasMenu()
          refreshes game stats, calls the animation thread to a stop and returns the display back to the also calls stopMusic() if soundOn
 void menuList()
          resturns the display back to the MenuList
 void menuListBluetoothGame()
          creates a new Bluetooth list menu
 void menuListBluetoothLevel()
          goes about building a multiplayer game, changes the display to the LevelCanvas, and calls playMusic() if soundOn
 void menuListContinue()
          returns the diaplay back tot the canvas, restarts the LevelCanvas and makes the player invincible
 void menuListHighScore()
          changes the display & creates an instance of the HighScoreScreen
 void menuListInstructions()
          creates a new Instructions screen
 void menuListNewGame()
          calls the initlaiser on the LevelCanvas and then the start's the game, while changing the display to the LevelCanvas, if soundOn then it calls to playMusic()
 void menuListQuit()
          quits the application and calls a stopMusic()
 void nextLevel()
          refreshes the game stats & creates an instance of the NextLevelScreen class
 void nextLevelDone()
          returns to the LevelCanvas
 void pauseApp()
          hear we handle the occurance of a pause, the animation thread is stoped
 void playBang()
          creats a new player to play /bang.wav, not called anywhere and thus temporaryly disabled
 void playMusic()
          palys the music loop's it for 100 counts
 int readRecordStore()
          reads the record store and returns an int value
 void refresh()
          refreshes the MIDlet variables of game statistics such that they can be accessed by other children classes
 void run()
          calls the init() initilzer method
 void splashScreenPainted()
          creates a thread while the splash screen is painted
 void startApp()
          inititation of the app and we decide weather this is the first time.
 void stopMusic()
          closes the songPlayer
 void vibrate(int millis)
          causes the display to vibrate for a passed int in millieseconds
 
Methods inherited from class javax.microedition.midlet.MIDlet
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

level

public int level

lives

public int lives

points

public int points

wallNumber

public int wallNumber

levelDroids

public int levelDroids

btHandle

public BluetoothHandle btHandle
Constructor Detail

MadnessMIDlet

public MadnessMIDlet()
Holds no constructors

Method Detail

startApp

public void startApp()
inititation of the app and we decide weather this is the first time. if it is the splash is called else we start the animation thread

Specified by:
startApp in class javax.microedition.midlet.MIDlet

pauseApp

public void pauseApp()
hear we handle the occurance of a pause, the animation thread is stoped

Specified by:
pauseApp in class javax.microedition.midlet.MIDlet

destroyApp

public void destroyApp(boolean unconditional)
calls a stop to the levelCanvas

Specified by:
destroyApp in class javax.microedition.midlet.MIDlet
Parameters:
unconditional - boolean value must be passed, false will ativate

run

public void run()
calls the init() initilzer method

Specified by:
run in interface java.lang.Runnable

splashScreenPainted

public void splashScreenPainted()
creates a thread while the splash screen is painted


menuListContinue

public void menuListContinue()
returns the diaplay back tot the canvas, restarts the LevelCanvas and makes the player invincible


menuListNewGame

public void menuListNewGame()
calls the initlaiser on the LevelCanvas and then the start's the game, while changing the display to the LevelCanvas, if soundOn then it calls to playMusic()


getCanvas

public LevelCanvas getCanvas()
returns the LevelCanvas

Returns:
LevelCanvas

getBluetooth

public BluetoothHandle getBluetooth()
returns the BluetoothHandle

Returns:
btHandle

menuListBluetoothLevel

public void menuListBluetoothLevel()
goes about building a multiplayer game, changes the display to the LevelCanvas, and calls playMusic() if soundOn


menuListInstructions

public void menuListInstructions()
creates a new Instructions screen


menuListQuit

public void menuListQuit()
quits the application and calls a stopMusic()


menuListBluetoothGame

public void menuListBluetoothGame()
creates a new Bluetooth list menu


nextLevelDone

public void nextLevelDone()
returns to the LevelCanvas


nextLevel

public void nextLevel()
refreshes the game stats & creates an instance of the NextLevelScreen class


gameOver

public void gameOver()
refreshes the game stats & creates an instance of the GameOverScreen class


gameOverDone

public void gameOverDone()
returns the display back to the MenuList and calls stopMusic()


menuList

public void menuList()
resturns the display back to the MenuList


menuListHighScore

public void menuListHighScore()
changes the display & creates an instance of the HighScoreScreen


refresh

public void refresh()
refreshes the MIDlet variables of game statistics such that they can be accessed by other children classes


levelCanvasMenu

public void levelCanvasMenu()
refreshes game stats, calls the animation thread to a stop and returns the display back to the also calls stopMusic() if soundOn


vibrate

public void vibrate(int millis)
causes the display to vibrate for a passed int in millieseconds

Parameters:
millis - vibrates the display for this period in millieseconds

getHighScore

public int getHighScore()
returns an int of the highest score

Returns:
highScore

checkHighScore

public boolean checkHighScore()
checks to see if the current score is high, if so, it writes it to the record store and returns true

Returns:
boolean

readRecordStore

public int readRecordStore()
reads the record store and returns an int value

Returns:
highScore int

playMusic

public void playMusic()
palys the music loop's it for 100 counts


stopMusic

public void stopMusic()
closes the songPlayer


playBang

public void playBang()
creats a new player to play /bang.wav, not called anywhere and thus temporaryly disabled


bluetoothHost

public void bluetoothHost()
sets the handset to act as the Host of a bluetooth game


bluetoothClient

public void bluetoothClient()
sets the handset to act as the Client of a bluetooth game