|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.microedition.lcdui.Displayable
|
+--javax.microedition.lcdui.Canvas
|
+--javax.microedition.lcdui.game.GameCanvas
|
+--LevelCanvas
LevelCanvas manages the multiple layers of Sprites and TiledLayers, by controlling the LayerManager, while running the animation beat methods for them. it accepts the keyStates from the handset and also handels many aspects of game play/events
Title: Monkey Madness
Description: Player must run around field, destroying and avoiding bombs, droids and boss!
Copyright: Copyright (c) 2005
Company: Pistachio Monkey
| Field Summary | |
boolean |
bossOn
|
boolean |
btGame
|
int |
canvsBeat
|
long |
gameDuration
|
int |
level
|
int |
levelDroids
|
int |
lives
|
int |
NumberOfDroids
|
int |
points
|
long |
startTime
|
int |
wallNumber
|
| Fields inherited from class javax.microedition.lcdui.game.GameCanvas |
DOWN_PRESSED, FIRE_PRESSED, GAME_A_PRESSED, GAME_B_PRESSED, GAME_C_PRESSED, GAME_D_PRESSED, LEFT_PRESSED, RIGHT_PRESSED, UP_PRESSED |
| Fields inherited from class javax.microedition.lcdui.Canvas |
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP |
| Method Summary | |
void |
bluetoothGame()
|
void |
build()
there are many items which constiute towards a level that are built upon a random generator, this method flushes and builds the TiledLayer's |
void |
buildBT()
builds a bluetooth version of the game, maps and sprites |
boolean |
collisionPlayerDroid()
returns true should a player & droid collide |
void |
draw()
draws the game to the screen |
Bomb |
getBomb()
retuns an instance of the bomb |
Boss |
getBoss()
retuns an instance of the boss |
java.util.Vector |
getDroid()
retuns an instance of the droid vector |
Field |
getField()
retuns an instance of the field |
Player |
getPlayer()
retuns an instance of the player |
Powerup |
getPowerup()
retuns an instance of the powerup |
void |
init()
initates the positions of all the sprites |
void |
invincible()
if the player dies, we ant them to become invincible for a period to ensure their safe return to the gaming field. this method calls a timer task to handle this. |
void |
keyPressed(int keyCode)
stops the game & returns the user back to the menu should they press a vlaue less than 0 |
void |
kill()
handels the event of the player being killed. it updates the statitics and readys the player for more action or deatch by passing the display to the GameOverScreen by calling the midlet |
void |
killTheUndead()
frequently invisable instances of the Droid can be found during the game, by calling this method we remove all items found within the droid vector |
void |
layerConstruct()
constructs all the layers in order |
void |
layerDroid()
handels the multiple constructions of droid |
void |
layerPlayers()
builds multiple players |
void |
newGame()
creats a new game |
void |
nextLevel()
prepares the game for the next level |
boolean |
overlapsBoss(javax.microedition.lcdui.game.Sprite sprite)
|
boolean |
overlapsDroid(javax.microedition.lcdui.game.Sprite sprite)
takse a sprtie droid and compares fowards it with an int of the number of droids |
boolean |
overlapsDroid(javax.microedition.lcdui.game.Sprite sprite,
int count)
checks to see if the sprite passed overlpas with any of the droids |
boolean |
overlapsOtherDroid(javax.microedition.lcdui.game.Sprite sprite)
checks to see if one droid overlaps another |
boolean |
overlapsPlayer(javax.microedition.lcdui.game.Sprite sprite)
returns true if the sprite passed collides with with the player sprite |
void |
playBang()
Calls the midlet to play an explosion |
void |
quit()
quits the game and returns the user to the menu using the midlet |
int |
random(int size)
calls the midlet to return a random int limited by the int passed |
void |
removeLayer(javax.microedition.lcdui.game.Sprite s)
removes a layer from the manager of the sprite passed |
void |
run()
creats a current thread and handels produces a beat to handle the constant drawing and flushing |
void |
start()
builds upon the animationThread, starts it and records the start time |
void |
stop()
records the gameduration and stops the animationThread |
void |
vibrate(int millis)
calls the midlet to vibrate for a passed int in milleseconds |
| Methods inherited from class javax.microedition.lcdui.game.GameCanvas |
flushGraphics, flushGraphics, getGraphics, getKeyStates, paint |
| Methods inherited from class javax.microedition.lcdui.Canvas |
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode, showNotify, sizeChanged |
| Methods inherited from class javax.microedition.lcdui.Displayable |
addCommand, getHeight, getTicker, getTitle, getWidth, isShown, removeCommand, setCommandListener, setTicker, setTitle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public int NumberOfDroids
public long startTime
public long gameDuration
public int level
public int lives
public int points
public int wallNumber
public int levelDroids
public int canvsBeat
public boolean bossOn
public boolean btGame
| Method Detail |
public void layerConstruct()
public void layerDroid()
public void layerPlayers()
public void keyPressed(int keyCode)
keyPressed in class javax.microedition.lcdui.CanvaskeyCode - key check for exception to quit, < 0public void quit()
public void kill()
public void invincible()
public void build()
public void buildBT()
public void killTheUndead()
public void nextLevel()
public void newGame()
public void bluetoothGame()
public void init()
public boolean overlapsPlayer(javax.microedition.lcdui.game.Sprite sprite)
sprite - sprite object
public boolean collisionPlayerDroid()
public boolean overlapsDroid(javax.microedition.lcdui.game.Sprite sprite)
sprite - a sprite object
public boolean overlapsBoss(javax.microedition.lcdui.game.Sprite sprite)
public boolean overlapsDroid(javax.microedition.lcdui.game.Sprite sprite,
int count)
sprite - sprite objectcount - the number of sprites to count through
public boolean overlapsOtherDroid(javax.microedition.lcdui.game.Sprite sprite)
sprite - sprite object
public void start()
public void stop()
public void run()
run in interface java.lang.Runnablepublic Field getField()
public Powerup getPowerup()
public Bomb getBomb()
public Player getPlayer()
public Boss getBoss()
public java.util.Vector getDroid()
public void vibrate(int millis)
millis - period of viobration milliesecondspublic void playBang()
public int random(int size)
size - limiter for the random generator
public void removeLayer(javax.microedition.lcdui.game.Sprite s)
s - sprite objectpublic void draw()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||