Class Powerup

java.lang.Object
  |
  +--javax.microedition.lcdui.game.Layer
        |
        +--javax.microedition.lcdui.game.TiledLayer
              |
              +--Powerup

public class Powerup
extends javax.microedition.lcdui.game.TiledLayer

powerup introduces specials for the player to collect

Title: Monkey Madness

Description: Player must run around field, destroying and avoiding bombs, droids and boss!

Copyright: Copyright (c) 2005

Company: Pistachio Monkey


Method Summary
 void buildPowerMap()
          build the array into a tile array
 void createPowerMap()
          calls for the powers to be randomly generated
 int getPowerCell(int row, int column)
          retrives the value of a cell from a given loaction
 int isPower(int x, int y, int width, int height)
          detects if sprie is on a power and allows them to collect it
 void powerFlush()
          clears the power array back to null
 void randomLocator(int counter, int value)
          randomly disperses powerups across the field
 
Methods inherited from class javax.microedition.lcdui.game.TiledLayer
createAnimatedTile, fillCells, getAnimatedTile, getCell, getCellHeight, getCellWidth, getColumns, getRows, paint, setAnimatedTile, setCell, setStaticTileSet
 
Methods inherited from class javax.microedition.lcdui.game.Layer
getHeight, getWidth, getX, getY, isVisible, move, setPosition, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

buildPowerMap

public void buildPowerMap()
build the array into a tile array


powerFlush

public void powerFlush()
clears the power array back to null


createPowerMap

public void createPowerMap()
calls for the powers to be randomly generated


randomLocator

public void randomLocator(int counter,
                          int value)
randomly disperses powerups across the field

Parameters:
counter - how many powerups
value - what type of power up

isPower

public int isPower(int x,
                   int y,
                   int width,
                   int height)
detects if sprie is on a power and allows them to collect it

Parameters:
x - x position
y - y position
width - width of the player sprite
height - height of the player sprite
Returns:
int powerup value

getPowerCell

public int getPowerCell(int row,
                        int column)
retrives the value of a cell from a given loaction

Parameters:
row - number
column - number
Returns:
cell number