谁有走逃出红房子子类型游戏的源代码?

J2me手机游戏项目三国战纪源代码 展示 GameMain.java源代码
- 下载整个 - 类型:.java文件
package com.ejoy;
//Download by
import java.io.IOException;
import java.util.Random;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.*;
public class GameMain extends GameCanvas implements Runnable
& & & & public MySprite role=null;//主角精灵,默认为站立
& & & & public MySprite enemy=null;//敌人精灵,默认为站立
& & & & //主角精灵各状态图片
& & & & public Image standimg;//精灵站立图片
& & & & public Image walkimg;//精灵行走图片
& & & & public Image attackimg;//精灵攻击图片
& & & & //地图状态及数据
& & & & public boolean isMapRoll=false;//地图卷动状态
& & & & public int mapY=0;//地图卷动y坐标偏移值
& & & & private Image bg;//地图图片
& & & & private Image mbg;//菜单图片
& & & & private Image cur;//箭头图片
& & & & public int curindex=0;
& & & & public Graphics mg;
& & & & public Thread cThread;
& & & & public boolean isRunning;
& & & & public int enemyXiuZheng=0;//地图卷动时,敌人精灵的位移修正值
& & & & //游戏中各种状态
& & & & public boolean isNormalThread=true;//游戏正常进程
& & & & //-------------role状态----------------
& & & & public boolean isStand=true;//是否是站立状态
& & & & public boolean isforward=true;//是否是向前
& & & & public int currentFrame=0;
& & & & public boolean isMove=false;
& & & & public boolean isUp=false;
& & & & public boolean isDown=false;
& & & & public boolean isLeft=false;
& & & & public boolean isRight=false;
& & & & public boolean isFire=false;
& & & & //-------------enemy状态-------------
& & & & public boolean isEnemyMove=false;//是否为移动状态
& & & & public boolean isEnemyXMove=false;//是否在x轴上移动
& & & & public boolean isEnemyYMove=false;//是否在y轴上移动
& & & & public boolean isEnemyStand=true;//是否站立状态
& & & & public boolean isEnemyAttack=false;//是否是攻击状态
& & & & public int attCount=0;//攻击频率控制
& & & & public int eframe=0;//敌人移动精灵当前帧
& & & & public int stepCount=0;//移动步数,防止频繁改变方向
& & & & public int standCount=0;//站立延时
& & & & private GameMIDlet m_gmid;
& & & & //------------------方向----------------------
& & & & public final static int EAST=0;
& & & & public final static int WEST=1;
& & & & public final static int SOUTH=2;
& & & & public final static int NORTH=3;
& & & & //随机对象
& & & & public Random rd;
& & & & //游戏中菜单状态
& & & & public boolean isGamingMenuShow=false;
& & & & //音乐管理器
& & & & public AVManager av;
& & & & public GameMain(GameMIDlet gm,int spName)
& & & & {
& & & & & & & & super(false);
& & & & & & & & m_gmid=gm;
& & & & & & & & mg=getGraphics();
& & & & & & & & isRunning=true;
& & & & & & & & rd=new Random();
& & & & & & & & setFullScreenMode(true);
& & & & & & & & try
& & & & & & & & {
& & & & & & & & & & & & if(spName==MySprite.ROLE_DC)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & role=new MySprite(Image.createImage(GameMIDlet.PATH_DC_STAND),54,72,spName);
& & & & & & & & & & & & & & & & role.setRefPixelPosition(GameMIDlet.SCREEN_WIDTH/2, role.spriteHeight);//设置主角初始位置
& & & & & & & & & & & & }
& & & & & & & & & & & & & & & &
& & & & & & & & & & & & if(spName==MySprite.ROLE_ZF)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & role=new MySprite(Image.createImage(GameMIDlet.PATH_ZF_STAND),60,108,spName);
& & & & & & & & & & & & & & & & role.setRefPixelPosition(GameMIDlet.SCREEN_WIDTH/2, role.spriteHeight);//设置主角初始位置
& & & & & & & & & & & & }
& & & & & & & & & & & &
& & & & & & & & & & & & bg=Image.createImage(GameMIDlet.PATH_GAME_BG);
& & & & & & & & & & & & mbg=Image.createImage(GameMIDlet.PATH_GMENU);
& & & & & & & & & & & & cur=Image.createImage(GameMIDlet.PATH_CUR);
& & & & & & & & }
& & & & & & & & catch(IOException e)
& & & & & & & & {
& & & & & & & & & & & & e.printStackTrace();
& & & & & & & & }
& & & & & & & &
& & & & & & & & av=new AVManager(m_gmid);
& & & & & & & & av.createPlayer(&/res/bg_2.mid&, AVManager.MEDIA_TYPE_MIDI);
& & & & & & & & av.init();
& & & & & & & & av.play();
& & & & & & & &
& & & & & & & & System.out.println(&GameMain构造函数!&);
& & & & }
& & & & //主角精灵逻辑处理
& & & & public void roleLogic()
& & & & {
& & & & & & & & if(isStand)
& & & & & & & & & & & & role.setFrame((currentFrame++)%role.getFrameSequenceLength());
& & & & & & & & else if(isMove)
& & & & & & & & {
& & & & & & & & & & & & if(isUp)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & //isStand=
& & & & & & & & & & & & & & & & role.changeToWalkSprite();
& & & & & & & & & & & & & & & & if(!adjustAndCollision(NORTH))
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & role.setRefPixelPosition(role.getRefPixelX(), role.getRefPixelY()-GameMIDlet.MOVE_ROLESPEED);
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & if(isforward)
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & role.setTransform(Sprite.TRANS_MIRROR_ROT180);
& & & & & & & & & & & & & & & & & & & & isforward=false;
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & currentFrame++;
& & & & & & & & & & & & }
& & & & & & & & & & & & else if(isDown)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & //isStand=
& & & & & & & & & & & & & & & & role.changeToWalkSprite();
& & & & & & & & & & & & & & & & if(!adjustAndCollision(SOUTH))
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & role.setRefPixelPosition(role.getRefPixelX(), role.getRefPixelY()+GameMIDlet.MOVE_ROLESPEED);
& & & & & & & & & & & & & & & & & & & & if(!isMapRoll)
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & if(mapY+GameMIDlet.MOVE_ROLESPEED&GameMIDlet.MAPHEIGHT-GameMIDlet.SCREEN_HEIGHT)
& & & & & & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & mapY+=GameMIDlet.MOVE_ROLESPEED;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & enemyXiuZheng+=GameMIDlet.MOVE_ROLESPEED;
& & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & if(!isforward)
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & role.setTransform(Sprite.TRANS_NONE);
& & & & & & & & & & & & & & & & & & & & isforward=true;
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & currentFrame++;
& & & & & & & & & & & & }
& & & & & & & & & & & & else if(isLeft)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & role.changeToWalkSprite();
& & & & & & & & & & & & & & & & if(!adjustAndCollision(WEST))
& & & & & & & & & & & & & & & & & & & & role.setRefPixelPosition(role.getRefPixelX()-GameMIDlet.MOVE_ROLESPEED, role.getRefPixelY());
& & & & & & & & & & & &
& & & & & & & & & & & & & & & & role.setFrame((currentFrame++)%role.getFrameSequenceLength());
& & & & & & & & & & & & & & & & //currentFrame++;
& & & & & & & & & & & & }
& & & & & & & & & & & & else if(isRight)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & role.changeToWalkSprite();
& & & & & & & & & & & & & & & & if(!adjustAndCollision(EAST))
& & & & & & & & & & & & & & & & & & & & role.setRefPixelPosition(role.getRefPixelX()+GameMIDlet.MOVE_ROLESPEED, role.getRefPixelY());
& & & & & & & & & & & & & & & & role.setFrame((currentFrame++)%role.getFrameSequenceLength());
& & & & & & & & & & & & & & & & //currentFrame++;
& & & & & & & & & & & & }
& & & & & & & & & & & & & & & &
& & & & & & & & & & & & role.setFrame((currentFrame)%role.getFrameSequenceLength());
& & & & & & & & } else if(isFire)
& & & & & & & & {
& & & & & & & & & & & & System.out.println(&play animation&);
& & & & & & & & & & & & role.changeToAttackSprite();& & & & & & & & & &
& & & & & & & & & & & & role.setFrame((currentFrame++)%role.getFrameSequenceLength());
& & & & & & & & }
& & & & & & & & & & & &
& & & & & & & & & & & &
& & & & }
& & & & //游戏主类画布画画函数
& & & & public void run()
& & & & {
& & & & & & & & while(isRunning)
& & & & & & & & {
& & & & & & & & & & & & if(isNormalThread)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & long lastTime=System.currentTimeMillis();
& & & & & & & & & & & & & & & & mg.setColor(0x666666);
& & & & & & & & & & & & & & & & mg.fillRect(0, 0,getWidth() /*GameMIDlet.SCREEN_WIDTH*/, GameMIDlet.SCREEN_HEIGHT); & & & & & & & & & &
& & & & & & & & & & & & & & & & mg.drawImage(bg, 0, -mapY, 0);
& & & & & & & & & & & & & & & & roleLogic();
& & & & & & & & & & & & & & & & enemyLogic();
& & & & & & & & & & & & & & & & showEnemyAni();
& & & & & & & & & & & & & & & & detectRollMap();
& & & & & & & & & & & & & & & & //---begin----判断精灵之间的覆盖问题
& & & & & & & & & & & & & & & & if(enemy==null);
& & & & & & & & & & & & & & & & & & & & role.paint(mg);
& & & & & & & & & & & & & & & & if(enemy!=null)
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & setEnemyFTF();
& & & & & & & & & & & & & & & & & & & & if(role.getRefPixelX()-role.spriteWidth/2&enemy.getRefPixelX()-enemy.spriteWidth/2)
& & & & & & & & & & & & & & & & & & & & { & & &
& & & & & & & & & & & & & & & & & & & & & & & & enemy.paint(mg);
& & & & & & & & & & & & & & & & & & & & & & & & role.paint(mg);
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & else
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & &
& & & & & & & & & & & & & & & & & & & & & & & & role.paint(mg);
& & & & & & & & & & & & & & & & & & & & & & & & enemy.paint(mg);
& & & & & & & & & & & & & & & & & & & & & & & &
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & //------------end----------
& & & & & & & & & & & & & & & & flushGraphics();
& & & & & & & & & & & & & & & & long currentTime=System.currentTimeMillis();
& & & & & & & & & & & & & & & & int esp=(int)(currentTime-lastTime);
& & & & & & & & & & & & & & & & if(esp&1000/GameMIDlet.FPS)
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & try
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & Thread.sleep(1000/GameMIDlet.FPS-esp);
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & catch(Exception e)
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & e.printStackTrace();
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & }
& & & & & & & & & & & & else if(isGamingMenuShow)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & showMenu();
& & & & & & & & & & & & }
& & & & & & & & }
& & & & }
& & & & protected void keyPressed(int keyCode)
& & & & {
& & & & & & & & boolean bAction=false;
& & & & & & & & if(!isGamingMenuShow)
& & & & & & & & {
& & & & & & & & & & & & switch(keyCode)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & case GameCanvas.KEY_NUM2://游戏界面中左
& & & & & & & & & & & & & & & & & & & & isMove=true;
& & & & & & & & & & & & & & & & & & & & isStand=false;
& & & & & & & & & & & & & & & & & & & & isUp=true;
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case GameCanvas.KEY_NUM6://游戏界面中上
& & & & & & & & & & & & & & & & & & & & isMove=true;
& & & & & & & & & & & & & & & & & & & & isStand=false;
& & & & & & & & & & & & & & & & & & & & isRight=true;
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case GameCanvas.KEY_NUM8://游戏界面中右
& & & & & & & & & & & & & & & & & & & & isMove=true;
& & & & & & & & & & & & & & & & & & & & isStand=false;
& & & & & & & & & & & & & & & & & & & & isDown=true;
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case GameCanvas.KEY_NUM4://游戏界面中下
& & & & & & & & & & & & & & & & & & & & isMove=true;
& & & & & & & & & & & & & & & & & & & & isStand=false;
& & & & & & & & & & & & & & & & & & & & isLeft=true;
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case GameCanvas.KEY_NUM5://确定
& & & & & & & & & & & & & & & & & & & & isFire=true;
& & & & & & & & & & & & & & & & & & & & isStand=false;
& & & & & & & & & & & & & & & & & & & & isMove=false;
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case GameCanvas.KEY_POUND://调出游戏中菜单
& & & & & & & & & & & & & & & & & & & & isNormalThread=false;
& & & & & & & & & & & & & & & & & & & & isGamingMenuShow=true;
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case GameCanvas.KEY_STAR:
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & default:
& & & & & & & & & & & & & & & & & & & & & & & & bAction=true;
& & & & & & & & & & & & }
& & & & & & & & & & & &
& & & & & & & & & & & & if(bAction)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & switch(getGameAction(keyCode))
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & case GameCanvas.DOWN://游戏界面中右
& & & & & & & & & & & & & & & & & & & & & & & & isMove=true;
& & & & & & & & & & & & & & & & & & & & & & & & isStand=false;
& & & & & & & & & & & & & & & & & & & & & & & & isDown=true;
& & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & case GameCanvas.UP://游戏界面中左
& & & & & & & & & & & & & & & & & & & & & & & & isMove=true;
& & & & & & & & & & & & & & & & & & & & & & & & isStand=false;
& & & & & & & & & & & & & & & & & & & & & & & & isUp=true;
& & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & case GameCanvas.LEFT://游戏界面中下
& & & & & & & & & & & & & & & & & & & & & & & & isMove=true;
& & & & & & & & & & & & & & & & & & & & & & & & isStand=false;
& & & & & & & & & & & & & & & & & & & & & & & & isLeft=true;
& & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & case GameCanvas.RIGHT://游戏界面中上
& & & & & & & & & & & & & & & & & & & & & & & & isMove=true;
& & & & & & & & & & & & & & & & & & & & & & & & isStand=false;
& & & & & & & & & & & & & & & & & & & & & & & & isRight=true;
& & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & case GameCanvas.FIRE:
& & & & & & & & & & & & & & & & & & & & & & & & isFire=true;
& & & & & & & & & & & & & & & & & & & & & & & & isStand=false;
& & & & & & & & & & & & & & & & & & & & & & & & isMove=false;
& & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & &
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & }
& & & & & & & & }
& & & & & & & & else//菜单选择的按键事件
& & & & & & & & {
& & & & & & & & & & & & switch(keyCode)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & case GameCanvas.KEY_NUM6://上移菜单项
& & & & & & & & & & & & & & & & & & & & if(curindex!=0)
& & & & & & & & & & & & & & & & & & & & & & & & curindex--;
& & & & & & & & & & & & & & & & case GameCanvas.KEY_NUM4://下移菜单项
& & & & & & & & & & & & & & & & & & & & if(curindex!=3)
& & & & & & & & & & & & & & & & & & & & & & & & curindex++;
& & & & & & & & & & & & & & & & case GameCanvas.KEY_NUM5://确定
& & & & & & & & & & & & & & & & & & & & switch(curindex)
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & case 0:
& & & & & & & & & & & & & & & & & & & & & & & & & & & & isNormalThread=true;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & isGamingMenuShow=false;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & & & & & case 1:
& & & & & & & & & & & & & & & & & & & & & & & & & & & & av.releaseMediaResource();
& & & & & & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & & & & & case 2:
& & & & & & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & & & & & case 3:
& & & & & & & & & & & & & & & & & & & & & & & & & & & & try
& & & & & & & & & & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & m_gmid.exit();
& & & & & & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & & & & & & catch(Exception e)
& & & & & & & & & & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & e.printStackTrace();
& & & & & & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & default:
& & & & & & & & & & & & & & & & & & & & bAction=true;
& & & & & & & & & & & & & & & & if(bAction)
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & switch(getGameAction(keyCode))
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & case GameCanvas.LEFT:
& & & & & & & & & & & & & & & & & & & & & & & & & & & & if(curindex!=3)
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & curindex++;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & & & & & case GameCanvas.RIGHT:
& & & & & & & & & & & & & & & & & & & & & & & & & & & & if(curindex!=0)
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & curindex--;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & & & & & case GameCanvas.FIRE:
& & & & & & & & & & & & & & & & & & & & & & & & & & & & switch(curindex)
& & & & & & & & & & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & case 0:
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & isNormalThread=true;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & isGamingMenuShow=false;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & case 1:
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & av.releaseMediaResource();
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & case 2:
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & case 3:
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & try
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & m_gmid.exit();
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & catch(Exception e)
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & e.printStackTrace();
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & }
& & & & & & & & }
& & & & }
& & & & /**
& & & & &* 游戏中菜单
& & & & &* @param g 菜单画笔
& & & & &*/
& & & & public void showMenu()
& & & & {
& & & & & & & & if(mbg!=null&&cur!=null)
& & & & & & & & {
& & & & & & & & & & & & //mg.drawRGB(convertToAlpha(mbg), 0, mbg.getWidth(), 0, 0, mbg.getWidth(), mbg.getHeight(), true);
& & & & & & & & & & & & mg.drawImage(mbg,(GameMIDlet.SCREEN_WIDTH-mbg.getWidth())/2, (GameMIDlet.SCREEN_HEIGHT-mbg.getHeight())/2, 0);
& & & & & & & & & & & & mg.drawImage(cur, 125-curindex*33, 40, 0);
& & & & & & & & }
& & & & & & & & flushGraphics();
& & & & }
& & & & //主角精灵的碰撞检测
& & & & public boolean adjustAndCollision(int dir)
& & & & {
& & & & & & & & boolean tmp=false;
& & & & & & & & switch(dir)
& & & & & & & & {
& & & & & & & & & & & & case EAST:
& & & & & & & & & & & & & & & & if(role.getRefPixelX()-role.spriteWidth/2+GameMIDlet.MOVE_ROLESPEED&GameMIDlet.XTLINE)
& & & & & & & & & & & & & & & & & & & & tmp=true;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & case WEST:
& & & & & & & & & & & & & & & & if(role.getRefPixelX()-role.spriteWidth/2-GameMIDlet.MOVE_ROLESPEED&GameMIDlet.XBLINE)
& & & & & & & & & & & & & & & & & & & & tmp=true;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & case SOUTH:
& & & & & & & & & & & & & & & & if(role.getRefPixelY()+GameMIDlet.MOVE_ROLESPEED&GameMIDlet.SCREEN_HEIGHT)//该值在支持地图转动时需修改
& & & & & & & & & & & & & & & & & & & & tmp=true;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & case NORTH:
& & & & & & & & & & & & & & & & if(role.getRefPixelY()-GameMIDlet.MOVE_ROLESPEED&0)//该值在支持地图转动时需修改
& & & & & & & & & & & & & & & & & & & & tmp=true;
& & & & & & & & & & & & & & & & break;
& & & & & & & & }
& & & & & & & & return tmp;
& & & & }
& & & & protected void keyReleased(int keyCode)
& & & & {
& & & & & & & & //System.out.println(&keyRelease key&);
& & & & & & & & role.resume();
& & & & & & & & isStand=true;
& & & & & & & & boolean bAction=false;
& & & & & & & & switch(keyCode)
& & & & & & & & {
& & & & & & & & & & & & case GameCanvas.KEY_NUM2:
& & & & & & & & & & & & & & & & isMove=false;
& & & & & & & & & & & & & & & & isUp=false;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & case GameCanvas.KEY_NUM6:
& & & & & & & & & & & & & & & & isMove=false;
& & & & & & & & & & & & & & & & isRight=false;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & case GameCanvas.KEY_NUM8:
& & & & & & & & & & & & & & & & isMove=false;
& & & & & & & & & & & & & & & & isDown=false;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & case GameCanvas.KEY_NUM4:
& & & & & & & & & & & & & & & & isMove=false;
& & & & & & & & & & & & & & & & isLeft=false;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & case GameCanvas.KEY_NUM5:
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & default:
& & & & & & & & & & & & & & & & bAction=true;
& & & & & & & & }
& & & & & & & & if(bAction)
& & & & & & & & {
& & & & & & & & & & & & switch(getGameAction(keyCode))
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & case GameCanvas.UP:
& & & & & & & & & & & & & & & & & & & & isMove=false;
& & & & & & & & & & & & & & & & & & & & isUp=false;
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case GameCanvas.DOWN:
& & & & & & & & & & & & & & & & & & & & isMove=false;
& & & & & & & & & & & & & & & & & & & & isDown=false;
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case GameCanvas.LEFT:
& & & & & & & & & & & & & & & & & & & & isMove=false;
& & & & & & & & & & & & & & & & & & & & isLeft=false;
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case GameCanvas.RIGHT:
& & & & & & & & & & & & & & & & & & & & isMove=false;
& & & & & & & & & & & & & & & & & & & & isRight=false;
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & }
& & & & & & & & }
& & & & }
& & & & //npc精灵部分
& & & & //产生enemy的条件
& & & & public void createNPCCondition()
& & & & { & & &
& & & & & & & & //System.out.println(role.getRefPixelY());
& & & & & & & & //System.out.println(GameMIDlet.SCREEN_HEIGHT/2);
& & & & & & & & //System.out.println(&createNPCCondition函数调用&);
& & & & & & & & if(role.getRefPixelY()&GameMIDlet.SCREEN_HEIGHT/2&&role.getRefPixelY()&GameMIDlet.SCREEN_HEIGHT)
& & & & & & & & {
& & & & & & & & & & & & //System.out.println(&test1&);
& & & & & & & & & & & & if(enemy==null)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & enemy=createNPC();
& & & & & & & & & & & & & & & & if(enemy!=null)
& & & & & & & & & & & & & & & & & & & & initNPCPosition(enemy);
& & & & & & & & & & & & }
& & & & & & & & }
& & & & & & & & if(role.getRefPixelY()&GameMIDlet.SCREEN_HEIGHT&&role.getRefPixelY()&GameMIDlet.SCREEN_HEIGHT*3/2)
& & & & & & & & {
& & & & & & & & & & & & if(enemy==null)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & enemy=createNPC();
& & & & & & & & & & & & & & & & if(enemy!=null)
& & & & & & & & & & & & & & & & & & & & initNPCPosition(enemy);
& & & & & & & & & & & & }
& & & & & & & & }
& & & & }
& & & & //敌人精灵产生函数
& & & & public MySprite createNPC()
& & & & {
& & & & & & & & System.out.println(&createNPC函数&);
& & & & & & & & MySprite tmp=null;
& & & & & & & & int npcNameStyle=rd.nextInt(4)+2;
& & & & & & & & try
& & & & & & & & {
& & & & & & & & & & & & switch(npcNameStyle)
& & & & & & & & & & & & { & & & & & & & & & & &
& & & & & & & & & & & & & & & & case MySprite.NPC_CB:
& & & & & & & & & & & & & & & & & & & & tmp=new MySprite(Image.createImage(GameMIDlet.PATH_CB_STAND),MySprite.NPC_CB_SPWIDTH,MySprite.NPC_CB_SPHEIGHT,MySprite.NPC_CB);
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case MySprite.NPC_DB:
& & & & & & & & & & & & & & & & & & & & tmp=new MySprite(Image.createImage(GameMIDlet.PATH_DB_STAND),MySprite.NPC_DB_SPWIDTH,MySprite.NPC_DB_SPHEIGHT,MySprite.NPC_DB);
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case MySprite.NPC_TM:
& & & & & & & & & & & & & & & & & & & & tmp=new MySprite(Image.createImage(GameMIDlet.PATH_TM_STAND),MySprite.NPC_TM_SPWIDTH,MySprite.NPC_TM_SPHEIGHT,MySprite.NPC_TM);
& & & & & & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & & & & & case MySprite.NPC_ZL:
& & & & & & & & & & & & & & & & & & & & tmp=new MySprite(Image.createImage(GameMIDlet.PATH_ZL_STAND),MySprite.NPC_ZL_SPWIDTH,MySprite.NPC_ZL_SPHEIGHT,MySprite.NPC_ZL);
& & & & & & & & & & & & & & & & & & & & break;& & & & & & & & &
& & & & & & & & & & & & }
& & & & & & & & }catch(IOException e)
& & & & & & & & {
& & & & & & & & & & & & e.printStackTrace();
& & & & & & & & }
& & & & & & & &
& & & & & & & &
& & & & & & & & return tmp;
& & & & }
//& & & 初始化npc精灵的初始位置
& & & & public void initNPCPosition(MySprite ms)
& & & & {
& & & & & & & & System.out.println(&initNPCPosition函数&);& & & & & &
& & & & & & & & int rondomX=rd.nextInt(GameMIDlet.XTLINE-GameMIDlet.XBLINE);//npc随机出现的宽度值 & & & & & & &
& & & & & & & & ms.setRefPixelPosition(GameMIDlet.XTLINE+ms.spriteWidth/2-rondomX, GameMIDlet.SCREEN_HEIGHT+ms.spriteHeight/2);
& & & & & & & &
& & & & }
& & & & //enemy精灵逻辑处理
& & & & public void enemyLogic()
& & & & {
& & & & & & & & createNPCCondition();
& & & & & & & & opStrategy();
& & & & & & & &
& & & & }
& & & & //AI状态决策
& & & & public void opStrategy()
& & & & {
& & & & & & & & if(enemy!=null&&isEnemyStand)
& & & & & & & & {
& & & & & & & & & & & & int wcando=rd.nextInt(100);//站立状态下转换其他状态的概率,50%转换状态
& & & & & & & & & & & & if(wcando&50&&standCount==0)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & System.out.println(&opStrategy::x_distance:&+enemy.getXDistanceFromSprite(role));
& & & & & & & & & & & & & & & & System.out.println(&opStrategy::y_distance:&+enemy.getYDistanceFromSprite(role));
& & & & & & & & & & & & & & & & if(Math.abs(enemy.getXDistanceFromSprite(role))&10||Math.abs(enemy.getYDistanceFromSprite(role))&10)//x,y轴两精灵相距达10像素时,70%移动,30%攻击
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & int canOp=rd.nextInt(100);
& & & & & & & & & & & & & & & & & & & & if(canOp&30)//70%移动
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyMove=true;
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyStand=false;
& & & & & & & & & & & & & & & & & & & & & & & & int level=70;
& & & & & & & & & & & & & & & & & & & & & & & & int dirsel=rd.nextInt(100);
& & & & & & & & & & & & & & & & & & & & & & & & if(Math.abs(enemy.getRefPixelX()-role.getRefPixelX())&(Math.abs(enemy.getRefPixelY()-role.getRefPixelY())-40))//比较两精灵x,y轴向距离,距离大的70%优先
& & & & & & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & level=30;
& & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & & if(dirsel&level)//x轴向移动状态
& & & & & & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & isEnemyXMove=true;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & isEnemyAttack=false;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & stepCount=6;
& & & & & & & & & & & & & & & & & & & & & & & & & & & &
& & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & & else//y轴向移动状态
& & & & & & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & isEnemyYMove=true;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & isEnemyAttack=false;
& & & & & & & & & & & & & & & & & & & & & & & & & & & & stepCount=8;
& & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & & & & &
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & else//30%攻击
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyAttack=true;
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyStand=false;
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyMove=false;
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & System.out.println(&opStrategy::isEnemyMove:&+isEnemyMove);
& & & & & & & & & & & & & & & & & & & & System.out.println(&x:&+isEnemyXMove+& &+&y:&+isEnemyYMove);
& & & & & & & & & & & & & & & & & & & & System.out.println(&opStrategy::isEnemyAttack:&+isEnemyAttack);
& & & & & & & & & & & & & & & & & & & & System.out.println(&opStrategy::isEnemyStand:&+isEnemyStand);
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & else//根据距离,50%攻击
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & int canOp=rd.nextInt(100);
& & & & & & & & & & & & & & & & & & & & if(canOp&50)
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & &
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyAttack=true;
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyStand=false;
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyMove=false;
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & else
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyAttack=false;
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyStand=true;
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyMove=false;
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & System.out.println(&opStrategy::isEnemyMove:&+isEnemyMove);
& & & & & & & & & & & & & & & & & & & & System.out.println(&opStrategy::isEnemyAttack:&+isEnemyAttack);
& & & & & & & & & & & & & & & & & & & & System.out.println(&opStrategy::isEnemyStand:&+isEnemyStand);
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & }
& & & & & & & & & & & & else//站立时状态维持standCount次,防止过快改变状态
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & if(standCount==0)
& & & & & & & & & & & & & & & & & & & & standCount=8;
& & & & & & & & & & & & & & & & enemy.resume();
& & & & & & & & & & & & & & & & eframe++;
& & & & & & & & & & & & & & & & enemy.setFrame((eframe)%enemy.getFrameSequenceLength());
& & & & & & & & & & & & & & & & if(standCount!=0)
& & & & & & & & & & & & & & & & & & & & standCount--;
& & & & & & & & & & & & }
& & & & & & & & }
& & & & }
& & & & //精灵状态间形态变化
& & & & public void showEnemyAni()
& & & & {
& & & & & & & & if(!isEnemyStand&&enemy!=null)
& & & & & & & & {
& & & & & & & & & & & & //System.out.println(&showEnemyAni函数调用&);
& & & & & & & & & & & & if(isEnemyMove)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & enemy.changeToWalkSprite();
& & & & & & & & & & & & & & & & if(isEnemyXMove&&stepCount&0)
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & if((enemy.getRefPixelX()-role.getRefPixelX())&0)
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & if(!enemyAdjustAndCollision(WEST))
& & & & & & & & & & & & & & & & & & & & & & & & enemy.setRefPixelPosition(enemy.getRefPixelX()-GameMIDlet.MOVE_SPEED, enemy.getRefPixelY());
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & else
& & & & & & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & & & & & if(!enemyAdjustAndCollision(EAST))
& & & & & & & & & & & & & & & & & & & & & & & & & & & & enemy.setRefPixelPosition(enemy.getRefPixelX()+GameMIDlet.MOVE_SPEED, enemy.getRefPixelY());
& & & & & & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & stepCount--;
& & & & & & & & & & & & & & & & & & & & if(stepCount==0)
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyStand=true;
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyMove=false;
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyXMove=false;
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & eframe++;
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & else if(isEnemyYMove&&stepCount&0)
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & if((enemy.getRefPixelY()-role.getRefPixelY())&0)
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & if(!enemyAdjustAndCollision(NORTH))
& & & & & & & & & & & & & & & & & & & & & & & & enemy.setRefPixelPosition(enemy.getRefPixelX(), enemy.getRefPixelY()-GameMIDlet.MOVE_SPEED);
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & else
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & if(!enemyAdjustAndCollision(SOUTH))
& & & & & & & & & & & & & & & & & & & & & & & & enemy.setRefPixelPosition(enemy.getRefPixelX(), enemy.getRefPixelY()+GameMIDlet.MOVE_SPEED);
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & stepCount--;
& & & & & & & & & & & & & & & & & & & & if(stepCount==0)
& & & & & & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyStand=true;
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyMove=false;
& & & & & & & & & & & & & & & & & & & & & & & & isEnemyYMove=false;
& & & & & & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & & & & & eframe++;
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & & enemy.setFrame((eframe)%enemy.getFrameSequenceLength());
& & & & & & & & & & & & }
& & & & & & & & & & & & else if(isEnemyAttack)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & if(attCount==0)
& & & & & & & & & & & & & & & & & & & & attCount=enemy.getFrameSequenceLength();
& & & & & & & & & & & & & & & & enemy.changeToAttackSprite();
& & & & & & & & & & & & & & & & attCount--;
& & & & & & & & & & & & & & & & if(attCount==0)
& & & & & & & & & & & & & & & & {
& & & & & & & & & & & & & & & & & & & & isEnemyAttack=false;
& & & & & & & & & & & & & & & & & & & & isEnemyStand=true;
& & & & & & & & & & & & & & & & & & & & isEnemyMove=false;
& & & & & & & & & & & & & & & & }
& & & & & & & & & & & & & & & &
& & & & & & & & & & & & & & & & enemy.setFrame((eframe++)%enemy.getFrameSequenceLength());
& & & & & & & & & & & & }
& & & & & & & & & & & & & & & &
& & & & & & & & & & & &
& & & & & & & & }
& & & & & & & & else
& & & & & & & & {
& & & & & & & & & & & & if(enemy!=null)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & enemy.resume();
& & & & & & & & & & & & & & & & enemy.setFrame(((eframe++)/2)%enemy.getFrameSequenceLength());
& & & & & & & & & & & & }
& & & & & & & & }
& & & & & & & &
& & & & }
& & & & /**
& & & & &* 敌人精灵碰撞检测
& & & & &* @param dir 方向
& & & & &* @return
& & & & &*/
& & & & public boolean enemyAdjustAndCollision(int dir)
& & & & {
& & & & & & & & boolean tmp=false;
& & & & & & & & switch(dir)
& & & & & & & & {
& & & & & & & & & & & & case EAST:
& & & & & & & & & & & & & & & & if(enemy.getRefPixelX()-enemy.spriteWidth/2+GameMIDlet.MOVE_SPEED&GameMIDlet.XTLINE)
& & & & & & & & & & & & & & & & & & & & tmp=true;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & case WEST:
& & & & & & & & & & & & & & & & if(enemy.getRefPixelX()-enemy.spriteWidth/2-GameMIDlet.MOVE_SPEED&GameMIDlet.XBLINE)
& & & & & & & & & & & & & & & & & & & & tmp=true;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & case SOUTH:
& & & & & & & & & & & & & & & & if(enemy.getRefPixelY()+GameMIDlet.MOVE_SPEED&GameMIDlet.SCREEN_HEIGHT)//该值在支持地图转动时需修改
& & & & & & & & & & & & & & & & & & & & tmp=true;
& & & & & & & & & & & & & & & & break;
& & & & & & & & & & & & case NORTH:
& & & & & & & & & & & & & & & & if(enemy.getRefPixelY()-GameMIDlet.MOVE_SPEED&0)//该值在支持地图转动时需修改
& & & & & & & & & & & & & & & & & & & & tmp=true;
& & & & & & & & & & & & & & & & break;
& & & & & & & & }
& & & & & & & & return tmp;
& & & & }
& & & & //设置敌人精灵面向主角
& & & & public void setEnemyFTF()
& & & & {
& & & & & & & & if(enemy.getRefPixelY()&role.getRefPixelY())
& & & & & & & & {
& & & & & & & & & & & & enemy.setTransform(Sprite.TRANS_MIRROR_ROT180);
& & & & & & & & } else
& & & & & & & & {
& & & & & & & & & & & & enemy.setTransform(Sprite.TRANS_NONE);
& & & & & & & & } & & &
& & & & & & & &
& & & & }
& & & & //地图卷动判断函数
& & & & public void detectRollMap()
& & & & {
& & & & & & & & if(!isMapRoll)
& & & & & & & & {
& & & & & & & & & & & & if(enemy!=null)
& & & & & & & & & & & & {
& & & & & & & & & & & & & & & & enemy.setRefPixelPosition(enemy.getRefPixelX(), enemy.getRefPixelY()-enemyXiuZheng);
& & & & & & & & & & & & & & & & enemyXiuZheng=0;
& & & & & & & & & & & & }
& & & & & & & & }
& & & & & & & &
& & & & & & & & /*if(role.getRefPixelY()&GameMIDlet.SCREEN_HEIGHT/2&&role.getRefPixelY()&GameMIDlet.SCREEN_HEIGHT*3/2)
& & & & & & & & {
& & & & & & & & & & & & isMapRoll=
& & & & & & & & }
& & & & & & & & if()*/
& & & & }
& & & & //扩展功能,菜单透明化
& & & & public int[] convertToAlpha(Image in)
& & & & {
& & & & & & & &
& & & & & & & & int[] buff=new int[in.getWidth()*in.getHeight()];
& & & & & & & & in.getRGB(buff, 0, in.getWidth(), 0, 0, in.getWidth(), in.getHeight());
& & & & & & & & for(int i=0;i&buff.length;i++)
& & & & & & & & {
& & & & & & & & & & & & buff[i]=(buff[i]&0x00ffff)|0xb40000;
& & & & & & & & }
& & & & & & & & return buff;
& & & & }
- 下载整个
相关源码/软件:
- 合金弹头游戏源代码,据说代码写的很有质量,拿出来共享给大家,希望有经验的高手们发挥才智继续更新完善。
- 韩国LG手机上的一款J2ME游戏泡泡堂源码,运行截图如下所示,声音需要LG特有的API支持才行,找不...
- 这是个双人对战的乒乓球游戏,基于JAVA语言开发,附有完整源码。游戏过程中配有音乐,通过这个实例你可...
- Java超级玛莉源代码,新手可以试着编译一下。压缩包内有完整编译生成的JAR文件,导入手机就可以运行...
- SnakeScript是一款JAVA游戏模拟脚本引擎,程序代码类似于C。
- 一个漂亮的烟花特效,用JAVA写的,运行于APPLET,网页上可以运行,鼠标每点击一下就会放一个烟花...
- Java游戏使命的召唤源码,又名:Call of Duty,MFORMA超精典游戏,有兴趣的可以重新...
- 基于J2ME的手机游戏落日恶魔源程序文件,需要对应手机开发包,本游戏界面比较炫丽,程序稍嫌复杂,需要...
- 这款源码对学习J2ME编程的朋友比较有用处,不但含有完整的源代码文件,还附有技术开发文档以及游戏运行...
- 一款JAVA网络格斗游戏,分服务端和游戏端,通过这个源代码你可以了解到用JAVA编写网络服务端的实例...
- 因为以前就会写贪吃蛇游戏,这也是初学Delphi的朋友的必修课,我个人觉得当初我写的贪吃蛇功能还算全...
- PowerNotePad 就一个不错的文本编辑器,功能上比系统的记事本要强大,类似写字板的功能,这是...
- JPEG图像文件解码源码,纯Delphi编写,更底层的解码,对了解JPEG文件结构有不少的帮助,同时...
- 纯Delphi实现空当接龙游戏,类似纸牌游戏的界面,不过玩法稍微不同,游戏开始后,抓有黑桃7 的玩家...
- 一个Delphi算法,通过特殊的方式保护密码,防止被盗。
- Delphi票据打印与管理系统(SQL2000),数据库,主程序及客户端都比较完整,不过用了一些三方...
- 一个很不错的delphi 写的语音报时程序,直接编译就可以,内置声音资源,运行程序后可以报出你电脑上...
- Delphi图像处理一例,将一幅彩色JPG去色、反相、底片效果处理的源码,也是从网上找的,觉得还是对...
- 这是一个用Delphi写的PE文件加密程序,属于简单加密,它能在可执行exe文件的尾部添加一个新节(...
- 见到过少用VC、VB压缩数据的算法,但是Delphi版本的不多见,经过多方搜索资料,自己写了一些De...

我要回帖

更多关于 逃出红房子 的文章

 

随机推荐