import java.io.IOException;
import javax.microedition.lcdui.*;
public class Tools
{
public static boolean bRun = false;
public static boolean bIsGame = false;
public static boolean bUp = false;
public static boolean bDown = false;
public static boolean bLeft = false;
public static boolean bRight = false;
public static boolean bFire = false;
public static boolean bSoundOn = true;
public static final int screenWidth = 180;
public static final int screenHeight = 177;
public static final int FPS = 25;
public static byte gameState = 0;
public static final byte GAME_LOGO = 0;
public static final byte GAME_MENU = 1;
public static final byte GAME_START = 2;
public static final byte GAME_CONTINUE = 3;
public static final byte GAME_SYSTEM = 4;
public static final byte GAME_HELP = 5;
public static final byte GAME_EXIT = 6;
public static final byte GAME_IN_RESUME = 0;
public static final byte GAME_IN_INSTRUCTIONS = 1;
public static final byte GAME_IN_SOUND = 2;
public static final byte GAME_IN_MAIN_MENU = 3;
public static final byte GAME_IN_EXIT = 4;
public static Image createImage(String ImagePath)
{
Image img = null;
try
{
img = Image.createImage(ImagePath);
}
catch (IOException e)
{
e.printStackTrace();
}
return img;
}
public static void drawImage(int x , int y, int ImageWidth , int ImageHeight , int screenX , int screenY , Graphics g , Image img )
{
g.setClip(screenX, screenY, ImageWidth, ImageHeight);
g.drawImage(img, screenX, screenY, 0);
// g.setClip(0, 0, screenWidth, screenHeight);
}
public static void menuArray(String array[], int index, int RGB1, int RGB2, int x, int y, int height, Graphics g)
{
for(int i=0;i<array.length;i++)
{
if(i==index)
{
g.setColor(RGB1);
g.drawString(array[i], x, y+i*height, 0);
}
else
{
g.setColor(RGB2);
g.drawString(array[i], x, y+i*height, 0);
}
}
}
}