91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 47KB
    文件類型: .rar
    金幣: 2
    下載: 1 次
    發(fā)布日期: 2024-01-26
  • 語(yǔ)言: 其他
  • 標(biāo)簽:

資源簡(jiǎn)介

一個(gè)使用J2ME技術(shù)編寫的RPG游戲Demo,包括地圖繪制、人物移動(dòng)和碰撞處理,以及界面切換,使用MIDP1.0實(shí)現(xiàn),總體結(jié)構(gòu)采用狀態(tài)機(jī)模型

資源截圖

代碼片段和文件信息

import?javax.microedition.lcdui.*;

/**
?*?RPG游戲示例代碼?實(shí)現(xiàn)了按鍵的連續(xù)移動(dòng)
?*/
public?class?RPGCanvas?extends?Canvas?implements?Runnable?{

/**?游戲狀態(tài)?*/
private?int?status;

//?游戲狀態(tài)設(shè)定
/**?村莊1?*/
private?final?static?int?SCREEN_1?=?0;

/**?武器店?*/
private?final?static?int?WEAPON_SHOP?=?10;

/**?對(duì)話狀態(tài)1?*/
private?final?static?int?DIALOAG_1?=?100;

//?場(chǎng)景1地圖數(shù)組
int?backmap0[][]?=?{?{?1?11?12?1?76?1?1?1?78?1?1?1?}
{?19?20?21?22?73?80?81?1?77?68?1?1?}
{?28?29?30?31?32?1?1?1?1?1?1?1?}
{?37?38?39?31?41?1?1?1?1?1?54?1?}
{?46?47?48?49?50?1?1?1?1?1?1?1?}
{?55?74?57?58?59?1?1?1?1?1?1?1?}
{?79?75?66?67?1?1?1?3?4?5?1?1?}
{?1?1?1?1?1?1?1?2?13?14?1?1?}
{?1?1?1?1?1?1?1?1?1?1?1?1?}
{?54?27?24?24?23?83?24?24?24?24?26?54?}
{?15?43?9?9?23?83?9?9?9?9?25?15?}
{?54?42?33?33?23?83?33?33?33?33?34?54?}
{?1?1?1?1?84?84?1?1?1?1?1?1?}?};

//?圖塊常量
/**?每個(gè)圖塊的寬度?*/
private?final?static?int?TILE_WIDTH?=?16;
/**?每個(gè)圖塊的高度?*/
private?final?static?int?TILE_HEIGHT?=?16;

/**?場(chǎng)景1圖片?*/
Image?screen_1?=?null;

/**?地圖原始圖片?*/
Image?map0Img?=?null;

/**?人物原始圖片?*/
Image?roleImg?=?null;
/**?人物的x坐標(biāo)?*/
int?roleX?=?100;
/**?任務(wù)的y坐標(biāo)?*/
int?roleY?=?100;

/**?人物寬度?*/
private?final?static?int?ROLE_WIDTH?=?16;
/**?人物高度?*/
private?final?static?int?ROLE_HEIGHT?=?32;

/**?人物方向?*/
int?direction;
/**?人物當(dāng)前顯示圖片的序號(hào)?*/
int?currIndex?=?0;

/**?人物連續(xù)移動(dòng)的控制變量,-1代表不移動(dòng),其他方向和人物方向常量的規(guī)定相同?*/

int?roleMoveControl?=?-1;

/**?移動(dòng)速度,每次2個(gè)像素?*/
int?speed?=?4;

/**?不移動(dòng)?*/
private?final?static?int?NOT_MOVE?=?-1;

/**?人物方向常量?*/
private?final?static?int?DIRE_LEFT?=?9;
private?final?static?int?DIRE_RIGHT?=?6;
private?final?static?int?DIRE_UP?=?3;
private?final?static?int?DIRE_DOWN?=?0;

/**?屏幕寬度?*/
int?width;
/**?屏幕高度?*/
int?height;

/**?可行走區(qū)域地圖塊序號(hào)?*/
private?int[]?canMoveTile?=?{?1?2?3?4?5?13?14?23?32?41?50?59
66?67?83?};

/**武器名稱*/
private?String[]?weaponName?=?{
“軒轅劍“
“浪宇刀“
“匕首“
};

/**武器價(jià)格*/
private?int[]?weaponPrice?=?{
1000
2000
100
};




public?RPGCanvas()?{
try?{
map0Img?=?Image.createImage(“/map.png“);
roleImg?=?Image.createImage(“/player.png“);
}?catch?(Exception?e)?{
}

//全屏
this.setFullScreenMode(true);

width?=?this.getWidth();
height?=?this.getHeight();

//?啟動(dòng)線程
Thread?th?=?new?Thread(this);
th.start();
}

protected?void?paint(Graphics?g)?{
//?根據(jù)游戲狀態(tài)實(shí)現(xiàn)繪制
switch?(status)?{
case?SCREEN_1:
//?繪制場(chǎng)景
paintSCREEN_1(g);
//?繪制人物
paintRole(g);
break;
case?WEAPON_SHOP:
paintWEAPON_SHOP(g);
break;
case?DIALOAG_1:
paintDIALOAG_1(g);
break;
}
}

/**
?*?繪制場(chǎng)景1的方法
?*?
?*?@param?g
?*????????????畫筆
?*/
private?void?paintSCREEN_1(Graphics?g)?{
//

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----

?????文件????????246??2007-11-06?11:04??RPGDemo\.classpath

?????文件????????204??2007-11-30?09:58??RPGDemo\.eclipseme

?????文件????????249??2007-12-05?10:19??RPGDemo\.eclipseme.tmp\emulation\RPGDemo.jad

?????文件??????14491??2007-11-20?10:04??RPGDemo\.eclipseme.tmp\emulation\RPGDemo.jar

?????文件???????8438??2007-12-05?10:19??RPGDemo\.eclipseme.tmp\verified\classes\RPGCanvas.class

?????文件????????911??2007-11-30?09:58??RPGDemo\.eclipseme.tmp\verified\classes\RPGMIDlet.class

?????文件????????539??2007-11-06?11:04??RPGDemo\.project

?????文件????????208??2007-11-06?11:04??RPGDemo\.settings\org.eclipse.jdt.core.prefs

?????文件???????6949??2007-11-06?11:39??RPGDemo\classes\map.png

?????文件???????2078??2007-11-06?16:24??RPGDemo\classes\player.png

?????文件???????7711??2007-12-05?10:19??RPGDemo\classes\RPGCanvas.class

?????文件????????911??2007-11-30?09:58??RPGDemo\classes\RPGMIDlet.class

?????文件???????6949??2007-11-06?11:39??RPGDemo\res\map.png

?????文件???????2078??2007-11-06?16:24??RPGDemo\res\player.png

?????文件????????225??2007-11-06?11:05??RPGDemo\RPGDemo.jad

?????文件??????10790??2007-12-05?10:19??RPGDemo\src\RPGCanvas.java

?????文件????????632??2007-11-06?16:08??RPGDemo\src\RPGMIDlet.java

?????目錄??????????0??2007-11-30?09:58??RPGDemo\.eclipseme.tmp\verified\classes

?????目錄??????????0??2007-11-06?11:04??RPGDemo\.eclipseme.tmp\verified\libs

?????目錄??????????0??2007-11-06?11:04??RPGDemo\.eclipseme.tmp\emulation

?????目錄??????????0??2007-11-06?11:04??RPGDemo\.eclipseme.tmp\verified

?????目錄??????????0??2007-11-06?11:04??RPGDemo\.eclipseme.tmp

?????目錄??????????0??2007-11-06?11:04??RPGDemo\.settings

?????目錄??????????0??2007-11-30?09:58??RPGDemo\classes

?????目錄??????????0??2007-11-06?11:04??RPGDemo\deployed

?????目錄??????????0??2007-11-06?16:24??RPGDemo\res

?????目錄??????????0??2007-11-06?11:06??RPGDemo\src

?????目錄??????????0??2007-11-06?11:04??RPGDemo

-----------?---------??----------?-----??----

????????????????63609????????????????????28

............此處省略1個(gè)文件信息

評(píng)論

共有 條評(píng)論

相關(guān)資源