📄 mapinfo.java
字号:
import javax.microedition.lcdui.Image;
//Download by http://www.codefans.net
public class MapInfo
{
private int round1[][] =
{
{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },
{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 }
};
private int round2[][] =
{
{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },
{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 },{ 1 }
};
private Main main;
private tiledLayer tl_way;
private int ThisMap[][]; //当前使用地图数组
private ImageTools it;
private Image img;
private int W = 208,H = 256;
public MapInfo(Main main,int LV)
{
this.main = main;
switch (LV)
{
case 0:
case 1:
ThisMap = round1;
img = it.getImage("tile01");
break;
case 2:
case 3:
ThisMap = round2;
img = it.getImage("tile02");
break;
case 4:
ThisMap = round1;
img = it.getImage("tile02");
break;
}
tl_way = new tiledLayer(ThisMap[0].length,ThisMap.length,img,W,H);
for(int i = 0;i<ThisMap.length;i++)
for (int j = 0; j < ThisMap[0].length; j++)
tl_way.setCell(j,i,ThisMap[i][j]);
main.tl_way = null;
main.tl_way = this.tl_way;
img = null;
it = null;
main = null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -