⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 constant.java

📁 简单的J2ME手机小游戏 包含游戏的基本;
💻 JAVA
字号:
package com.wqat.SuperPig;

/**
 * 自定义常量类
 * 
 * @author wqat
 */

public class Constant
	{

		/***********************************************************************
		 * 
		 * 界面常量
		 * 
		 **********************************************************************/
		
		/**
		 * 游戏界面
		 */
		public static final int GAME = 0;

		/**
		 * 闪屏
		 */
		public static final int SPLASH = 1;

		/**
		 * 主菜单界面
		 */

		public static final int MENU = 2;

		/**
		 * 失败界面
		 */

		public static final int GAME_OVER = 3;

		/**
		 * 胜利界面
		 */

		public static final int Game_Vectory = 4;

		/**
		 * 帮助界面
		 */

		public static final int HELP = 5;

		

		/***********************************************************************
		 * 
		 * 颜色常量
		 * 
		 **********************************************************************/

		/**
		 * 白色
		 */
		public static final int COLOR_WHITE = 0xFFFFFF;

		/**
		 * 灰色
		 */
		public static final int COLOR_GRAY = 0xD9D9D9;

		/**
		 * 黑色
		 */
		public static final int COLOR_BLACK = 0x000000;

		/**
		 * 红色
		 */
		public static final int COLOR_RED = 0xFF0000;

		/**
		 * 黄色
		 */
		public static final int COLOR_YELLOW = 0xFFFF00;

		/***********************************************************************
		 * 
		 * 游戏常量
		 * 
		 **********************************************************************/

		/**
		 * 第一关
		 */
		public static final int FIRST_STAGE = 1;

		/**
		 * 最后一关
		 */
		public static final int LAST_STAGE = 3;

		/**
		 * 消息框背景色
		 */
		public static final int HELP_BGCOLOR = 0x00BFFF;

		/**
		 * 闪屏文字
		 */
		
		public static final String LOGO_TXT="按任意键跳过"; 
		
		public static final String[] COMPLETED_TIP =
			{ "已完成 ", "关卡" };

		/**
		 * 装载提示
		 */
		public static final String[] LOADING_TIP =
			{ "加载中", "关卡" };

		/**
		 * 游戏每帧绘制时间,单位为ms
		 */
		public static final int GAME_MSPF = 50;

		/**
		 * 游戏界面高度
		 */
		public static final int GAME_HEIGHT = 128;

		/**
		 * 游戏界面宽度
		 */
		public static final int GAME_WIDTH = 128;

		/**
		 * 地图格列数
		 */
		public static final int MAP_COLS = 8;

		/**
		 * 地图格行数
		 */
		public static final int MAP_ROWS = 7;

		/**
		 * 图像单元格高度
		 */
		public static final int CELL_HEIGHT = 16;

		/**
		 * 图像单元格宽度
		 */
		public static final int CELL_WIDTH = 16;

		/**
		 * 道具产生概率<br>
		 * 取值范围为1~100,表示1% ~ 100%,生成的道具为随机类别
		 */
		public static final int TOOL_PROBABILITY = 100;

		/***********************************************************************
		 * 
		 *                       图片路径
		 * 
		 **********************************************************************/
	
		/**
		 * 人物图片
		 */

		public static final String IMAGE_SRC_HERO = "/img/hero.png";
		/**
		 *怪物图片 
		 */

		public static final String IMAGE_SRC_ENEMY = "/img/enemy.png";

		/**
		 * 炸弹与道具图片
		 */

		public static final String IMAGE_SRC_ITEMS = "/img/items.png";
		
		/**
		 * 关卡图片
		 */
		public static final String IMAGE_DIR = "/img/";

		/**
		 * 地面层图片
		 */
		
		public static final String IMAGE_SRC_FLOOR = "/img/floor.png";
		
		/**
		 * 游戏学院logo
		 */
		
		public static final String IMAGE_SRC_LOGO1 = "/img/logo1.png";
		
		/**
		 * 中国移动logo
		 */
		
		public static final String IMAGE_SRC_LOGO2 = "/img/logo2.png";
		/**
		 * 游戏动画1
		 */
		
		public static final String IMAGE_SRC_G1 = "/img/g1.png";
		/**
		 * 游戏动画2
		 */
		
		public static final String IMAGE_SRC_G2 = "/img/g2.png";
		
		/**
		 * 游戏动画3
		 */
		
		public static final String IMAGE_SRC_G3 = "/img/g3.png";

		/***********************************************************************
		 * 
		 * 角色常量
		 * 
		 **********************************************************************/

		/**
		 * 出生时间<br>
		 * 该断时间内精灵做出出生动作
		 */
		public static final int BORN_TIME = 30;

		/**
		 * 休息指定时间<br>
		 * 当无操作时,精灵经过一段时间后进入休息状态
		 */
		public static final int REST_WAITTIME = 10;

		/**
		 * 死亡时间<br>
		 * 死亡时间内人物进行死亡动作,完成后人物失效
		 */
		public static final int DEAD_WAITTIME = 30;

		public static final int HERO_WIDTH = 16;

		public static final int HERO_HEIGHT = 24;

		/***********************************************************************
		 * 
		 * 地图常量
		 * 
		 **********************************************************************/

		public static final int GOLD_COIN_SCORE = 20;

		public static final int SILVER_COIN_SCORE = 10;

		/**
		 * 地砖贴图层
		 */
		public static final int LAYER_FLOOR = 0;

		/**
		 * 建筑贴图层
		 */
		public static final int LAYER_BUILDING = 1;

		/**
		 * 特性层
		 */
		public static final int LAYER_FEATURE = 2;

		/**
		 * 动画帧开始位置(第10帧以后为建筑摧毁动画)
		 */
		public static final int ANIMATION_START = 10;

		/**
		 * 物体破碎动画效果帧长
		 */
		public static final int ANIMATION_FRAMS = 5;

		/**
		 * 单元格可通行
		 */
		public static final int CAN_PASS = 1;

		/**
		 * 单元格可破坏
		 */
		public static final int CAN_DESTROY = 2;

		/**
		 * 单元格可推动
		 */
		public static final int CAN_PUSH = 4;

		/**
		 * 单元格致命
		 */
		public static final int DEADLY = 8;

		/**
		 * 单元格存在炸弹
		 */
		public static final int BOMB = 16;

		/***********************************************************************
		 * 
		 * 道具常量
		 * 
		 **********************************************************************/

		/**
		 * 炸弹
		 */
		public static final int TOOL_BOMB = 29;

		/**
		 * 能量药水
		 */
		public static final int TOOL_POWER = 30;

		/**
		 * 速度鞋
		 */
		public static final int TOOL_SPEED = 31;

		/**
		 * 金币
		 */
		public static final int TOOL_GOLD_COIN = 32;

	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -