飞行棋java源代码 java飞行棋游戏设计

java如何实现多人操作骑士飞行棋画MAP类:
package s1java.xmal1;
public class Map {
int[] map=new int[100];//0:普通
int[] luckyTurn=;//1:幸运轮盘
int[] landMine=;//2:地雷
int[] pause=;//3:暂停
int[] timeTunnel=; //4:时空隧道
//给map[]写入各种符号
public void createMap(){
for(inti=0;iluckyTurn.length;i++){
map[luckyTurn[i]]=1;
}
for(inti=0;ilandMine.length;i++){
map[landMine[i]]=2;
}
for(inti=0;ipause.length;i++){
map[pause[i]]=3;
}
for(inti=0;itimeTunnel.length;i++){
map[timeTunnel[i]]=4;
}
}
public void showMap(int playerPos1,int playerPos2){
showLine1(0,31,playerPos1,playerPos2);
showRLine(31,35,playerPos1,playerPos2);
showLine2(35,66,playerPos1,playerPos2);
showLLine(66,69,playerPos1,playerPos2);
showLine1(69,100,playerPos1,playerPos2);
}
public void showLine1(int start,int end,int playerPos1,int playerPos2){
for(int i=start;iend;i++ ){
System.out.print(getGraph(map[i],i,playerPos1,playerPos2));
}
System.out.println();
}
public void showRLine(int start,int end,int playerPos1,int playerPos2){
for(int i=start;iend;i++){
for(int j=0;j73;j++){
System.out.print("");
}
System.out.println(getGraph(map[i],i,playerPos1,playerPos2));
}
}
public void showLine2(int start,int end,int playerPos1,int playerPos2){
for(int i=end-1;i=start;i--){
System.out.print(getGraph(map[i],i,playerPos1,playerPos2));
}
System.out.println();
}
public void showLLine(int start,int end,int playerPos1,int playerPos2){
for(int i=start;iend;i++){
System.out.println(getGraph(map[i],i,playerPos1,playerPos2));
}
}
public String getGraph(int i,int index,int playerPos1,int playerPos2){
String graph=" ";
if(index==playerPos1index==playerPos2){
graph="@@";
}else if(index==playerPos1){
graph="A";
}else if(index==playerPos2){
graph="B";
}else{
switch(i){
case 1:
graph="¤";
break;
case 2:
graph="

    推荐阅读