📄 cmap.java~82~
字号:
package GoGoGo;
import java.io.*;
public class CMap
{
private GameViewBase m_View;
private Surface m_Surface_Ground=null;
boolean RollToLeft=false;
boolean RollToRight=false;
boolean RollToUp=false;
boolean RollToDown=false;
InputStream is;
DataInputStream dis;
boolean success=false;
//int BlockSize=40;
int MapX=0;
int MapY=0;
int MapblockSize=16;
int MapMoveSpeed=4;
//int MAP_ROW=6;//行
//int MAP_COL=40;//列
int ShowMapArrowX=0,ShowMapArrowY=0;
int m_i_MapHeight;
int m_i_MapWidth;
int TotalSize=50;
int MAP_DATE[][]=new int[TotalSize][TotalSize];
int map_src[] =
{331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331, 12, 13, 14, 15,
16, 17, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 270, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 282, 283, 284,
331, 331, 331, 12, 13, 14, 15, 16, 17, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 282, 283, 313, 313, 313, 283, 284, 331, 42, 43, 44, 45, 46,
47, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 270, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 312, 313, 313, 313, 313,
313, 283, 284, 72, 73, 74, 75, 76, 77, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 342, 343, 344, 313, 313, 313, 313, 314, 102, 103, 104, 105,
106, 107, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 270,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 270, 342,
343, 344, 343,
344, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 270, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 270, 331, 331, 331, 331, 331, 331, 360, 331, 331, 362,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 270, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 270, 331, 331,
331, 390, 391, 391, 392, 331, 331, 363, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 270, 331, 331, 363, 420, 421, 421, 421, 391,
392, 362, 271, 271, 271, 331, 331, 331, 331, 331, 331, 331, 331, 331,
270, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 270,
331, 360, 331, 420, 421, 421, 421, 421, 422, 331, 271, 271, 271, 331,
331, 331, 331, 331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 270, 331, 331, 390, 421, 421, 451,
451, 451, 452, 331,
271, 271, 271, 271, 331, 331, 331, 331, 331, 331, 331, 331, 270, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 270, 331, 390,
421, 421, 422, 363, 331, 360, 331, 331, 271, 271, 271, 331, 331, 331,
331, 331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 270, 331, 450, 421, 421, 421, 391, 392, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
270, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 270,
331, 363, 450, 451, 451, 451, 452, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 270, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 270, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
270, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 270,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 270, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 270, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 270, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 270, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 270, 331, 331, 331, 331,
331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331, 331,
331, 331, 331, 331,270};
public CMap(GameViewBase view)
{
m_View=view;
}
void Create(Surface m_Surface_ground) //由此传递初始化参数
{
m_Surface_Ground=m_Surface_ground;
ShowMapArrowX=m_View.m_i_ScreenWidth/MapblockSize+1;
ShowMapArrowY=m_View.m_i_ScreenHeight/MapblockSize+1;
}
//----------------------------------------------------------------------------------------------------------------------------------
public void LoadMap(int iStage)
{
// 331,331,331,331,331,270,331,331,331,331,331,12,13,14,15,16,17,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,282,283,284,331,331,331,12,13,14,15,16,17,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,282,283,313,313,313,283,284,331,42,43,44,45,46,47,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,312,313,313,313,313,313,283,284,72,73,74,75,76,77,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,342,343,344,313,313,313,313,314,102,103,104,105,106,107,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,342,343,344,343,344,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,360,331,331,362,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,390,391,391,392,331,331,363,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,363,420,421,421,421,391,392,362,271,271,271,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,360,331,420,421,421,421,421,422,331,271,271,271,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,390,421,421,451,451,451,452,331,271,271,271,271,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,390,421,421,422,363,331,360,331,331,271,271,271,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,450,421,421,421,391,392,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,363,450,451,451,451,452,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,270,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331,331</Data>
int i,j;
String S;
m_i_MapWidth=MAP_DATE[0].length;
m_i_MapHeight=MAP_DATE.length;
for(j=m_i_MapHeight-1;j>=0;j--)
{
for(i=m_i_MapWidth-1;i>=0;i--)
{
MAP_DATE[j][i]=-1;
}
}
// S="/"+String.valueOf(iStage)+".stage";
// is=getClass().getResourceAsStream(S);
// if(is==null)
// return;
// dis=new DataInputStream(is);
// try
// {
// i=dis.readInt();
// j=dis.readInt();
// m_i_MapWidth=Math.min(m_i_MapWidth,i);
// m_i_MapHeight=Math.min(m_i_MapHeight,j);
int z=0;
for(j=0;j<m_i_MapHeight;j++)
{
for(i=0;i<m_i_MapWidth;i++)
{
System.out.print(map_src.length);
// MAP_DATE[j][i]=dis.readChar();
if(z<1029)
MAP_DATE[j][i]= map_src[z++];
else
MAP_DATE[j][i]=331;
System.out.println(MAP_DATE[j][i]);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -