c++ 科幻版 沙漠神殿2

#include <iostream>
#include "minecraft.h"
#include <string>
using namespace std; 
TxMinecraft mc; 
int x,y,z; 
bool con;
bool lianjie(){
	return con=mc.ConnectMinecraft("mc.makeblock.net.cn","a9d44e758f6e4cf8b2da2624156f24d3");
}
//墙
void qiang();
//上下层
void p1();
//前后面
void p2();
//左右面
void p3();
int main(){ 
	if(!lianjie()){
		cout<<"连接失败";
		return 0; 
	}
	mc.setPlayerFly("wangyueshuo",true);
	cout<<"连接成功";
	cin>>x>>y>>z;
	mc.setVariable(x,y,z);
	//墙面 
	qiang();
	//上下层 		
	p1();
	//前后面 
	p2();
	//左右面
	p3(); 
	return 0;
}
	
//墙	
void qiang(){
	//上
	mc.fillOffsetBlocks(0,50,0,50,50,50,24,0);
	//下
	mc.fillOffsetBlocks(0,0,0,50,0,50,24,0);
	//前 
	mc.fillOffsetBlocks(0,0,0,50,50,0,24,0);
	//后 
	mc.fillOffsetBlocks(0,0,50,50,50,50,24,0);
	//左 
	mc.fillOffsetBlocks(0,0,0,0,50,50,24,0);
	//右 
	mc.fillOffsetBlocks(50,0,0,50,50,50,24,0);
}

//上下层
void p1(){
	for(int i=0;i<2;i++){
	//圆
	mc.offsetDrawCircle(25,50,25,13,251,14,mc.x);
	mc.offsetDrawCircle(25,50,25,7,251,14,mc.x);
	//边
	mc.offsetDrawLine(25,50,10,15,50,0,251,14);
	mc.offsetDrawLine(9,50,0,0,50,9,251,14);
	mc.offsetDrawLine(0,50,15,10,50,25,251,14);
	mc.offsetDrawLine(10,50,25,0,50,35,251,14);
	mc.offsetDrawLine(0,50,41,9,50,50,251,14);
	mc.offsetDrawLine(15,50,50,25,50,40,251,14);
	mc.offsetDrawLine(25,50,40,35,50,50,251,14);
	mc.offsetDrawLine(41,50,50,50,50,41,251,14);
	mc.offsetDrawLine(50,50,35,40,50,25,251,14);
	mc.offsetDrawLine(40,50,25,50,50,15,251,14);
	mc.offsetDrawLine(50,50,9,41,50,0,251,14);
	mc.offsetDrawLine(35,50,0,25,50,10,251,14);
	mc.setVariable(x,y-50,z);
	}
}
//前后面
void p2(){
	mc.setVariable(x,y,z);
	for(int i=0;i<2;i++){
	mc.offsetDrawLine(10,0,0,0,10,0,251,14);
	mc.offsetDrawLine(0,10,0,6,16,0,251,14);
	mc.offsetDrawLine(6,16,0,6,35,0,251,14);
	mc.offsetDrawLine(6,35,0,0,41,0,251,14);
	mc.offsetDrawLine(0,41,0,9,50,0,251,14);
	mc.offsetDrawLine(15,50,0,25,40,0,251,14);
	mc.offsetDrawLine(25,36,0,21,32,0,251,14);
	mc.offsetDrawLine(21,32,0,21,19,0,251,14);
	mc.offsetDrawLine(21,19,0,25,15,0,251,14);
	mc.setOffsetBlock(25,7,0,251,14);
	mc.offsetDrawLine(25,8,0,21,12,0,251,14);
	mc.offsetDrawLine(21,12,0,21,0,0,251,14);
	mc.offsetDrawLine(13,48,0,7,42,0,251,14);
	mc.offsetDrawLine(13,48,0,16,45,0,251,14);
	mc.offsetDrawLine(16,45,0,10,39,0,251,14);
	mc.offsetDrawLine(7,42,0,19,30,0,251,14);
	mc.offsetDrawLine(19,30,0,8,19,0,251,14);
	mc.offsetDrawLine(8,19,0,19,8,0,251,14);
	mc.offsetDrawLine(19,8,0,15,4,0,251,14);
	mc.offsetDrawLine(15,4,0,7,12,0,251,14);
	mc.offsetDrawLine(7,12,0,10,15,0,251,14);
	mc.offsetDrawLine(25,8,0,29,12,0,251,14);
	mc.offsetDrawLine(29,12,0,29,0,0,251,14);
	mc.offsetDrawLine(25,15,0,29,19,0,251,14);
	mc.offsetDrawLine(29,19,0,29,32,0,251,14);
	mc.offsetDrawLine(25,40,0,35,50,0,251,14);
	mc.offsetDrawLine(29,32,0,25,36,0,251,14);
	mc.offsetDrawLine(41,50,0,50,41,0,251,14);
	mc.offsetDrawLine(50,41,0,44,35,0,251,14);
	mc.offsetDrawLine(44,35,0,44,16,0,251,14);
	mc.offsetDrawLine(44,16,0,50,10,0,251,14);
	mc.offsetDrawLine(50,10,0,40,0,0,251,14);
	mc.offsetDrawLine(37,48,0,43,42,0,251,14);
	mc.offsetDrawLine(43,42,0,31,30,0,251,14);
	mc.offsetDrawLine(37,48,0,34,45,0,251,14);
	mc.offsetDrawLine(34,45,0,40,39,0,251,14);
	mc.offsetDrawLine(31,30,0,42,19,0,251,14);
	mc.offsetDrawLine(42,19,0,31,8,0,251,14);
	mc.offsetDrawLine(31,8,0,35,4,0,251,14);
	mc.offsetDrawLine(35,4,0,43,12,0,251,14);
	mc.offsetDrawLine(43,12,0,39,16,0,251,14);
	//挖空
		//四面三角形 
		int t=9;
		for(int j=0;j<10;j++){
			mc.offsetDrawLine(0+t,0+j,0,0,0+j,0,0,0);
			t--;	
		}
		t=0;
		for(int j=0;j<10;j++){
			mc.offsetDrawLine(41+t,0+j,0,50,0+j,0,0,0);
			t++;	
		}
		t=0;
		for(int i=0;i<9;i++){
			mc.offsetDrawLine(0+i,42+t,0,0+i,50,0,0,0);
			t++;
		}
		t=0;
		for(int j=42;j<51;j++){
			mc.offsetDrawLine(50,0+j,0,50-t,0+j,0,0,0);
			t++;	
		}
		//
	for(int i=0;i<6;i++){
		mc.offsetDrawLine(5-i,35+i,0,5-i,(35+i)-(19+i*2),0,0,0);
	}	
	for(int i=0;i<6;i++){
		mc.offsetDrawLine(45+i,35+i,0,45+i,(35+i)-(19+i*2),0,0,0);
	}	
	t=0;	
	for(int i=0;i<4;i++){
		mc.offsetDrawLine(25+i,35-t,0,25+i,16+t,0,95,14);
		mc.offsetDrawLine(25-i,35-t,0,25-i,16+t,0,95,14);
		t++;
	}
		//长方形 
		t=0;
		for(int i=0;i<4;i++){
			mc.offsetDrawLine(8+t,12+t,0,15+t,5+t,0,95,14);
			t++;
		}
		t=0;
		for(int i=0;i<3;i++){
			mc.offsetDrawLine(9+t,12+t,0,15+t,6+t,0,95,14);
			t++;
		}
		
	
	
	
	
	
	
		
	mc.setVariable(x,y,z+50);
	}
}
//左右面
void p3(){
	for(int i=0;i<2;i++){
	mc.offsetDrawLine(0,0,-10,0,10,-0,251,14);
	mc.offsetDrawLine(0,10,-0,0,16,-6,251,14);
	mc.offsetDrawLine(0,16,-6,0,35,-6,251,14);
	mc.offsetDrawLine(0,35,-6,0,41,-0,251,14);
	mc.offsetDrawLine(0,41,-0,0,50,-9,251,14);
	mc.offsetDrawLine(0,50,-15,0,40,-25,251,14);
	mc.offsetDrawLine(0,36,-25,0,32,-21,251,14);
	mc.offsetDrawLine(0,32,-21,0,19,-21,251,14);
	mc.offsetDrawLine(0,19,-21,0,15,-25,251,14);
	mc.setOffsetBlock(0,7,-25,251,14);
	mc.offsetDrawLine(0,8,-25,0,12,-21,251,14);
	mc.offsetDrawLine(0,12,-21,0,0,-21,251,14);
	mc.offsetDrawLine(0,48,-13,0,42,-7,251,14);
	mc.offsetDrawLine(0,48,-13,0,45,-16,251,14);
	mc.offsetDrawLine(0,45,-16,0,39,-10,251,14);
	mc.offsetDrawLine(0,42,-7,0,30,-19,251,14);
	mc.offsetDrawLine(0,30,-19,0,19,-8,251,14);
	mc.offsetDrawLine(0,19,-8,0,8,-19,251,14);
	mc.offsetDrawLine(0,8,-19,0,4,-15,251,14);
	mc.offsetDrawLine(0,4,-15,0,12,-7,251,14);
	mc.offsetDrawLine(0,12,-7,0,15,-10,251,14);
	mc.offsetDrawLine(0,8,-25,0,12,-29,251,14);
	mc.offsetDrawLine(0,12,-29,0,0,-29,251,14);
	mc.offsetDrawLine(0,15,-25,0,19,-29,251,14);
	mc.offsetDrawLine(0,19,-29,0,32,-29,251,14);
	mc.offsetDrawLine(0,40,-25,0,50,-35,251,14);
	mc.offsetDrawLine(0,32,-29,0,36,-25,251,14);
	mc.offsetDrawLine(0,50,-41,0,41,-50,251,14);
	mc.offsetDrawLine(0,41,-50,0,35,-44,251,14);
	mc.offsetDrawLine(0,35,-44,0,16,-44,251,14);
	mc.offsetDrawLine(0,16,-44,0,10,-50,251,14);
	mc.offsetDrawLine(0,10,-50,0,0,-40,251,14);
	mc.offsetDrawLine(0,48,-37,0,42,-43,251,14);
	mc.offsetDrawLine(0,42,-43,0,30,-31,251,14);
	mc.offsetDrawLine(0,48,-37,0,45,-34,251,14);
	mc.offsetDrawLine(0,45,-34,0,39,-40,251,14);
	mc.offsetDrawLine(0,30,-31,0,19,-42,251,14);
	mc.offsetDrawLine(0,19,-42,0,8,-31,251,14);
	mc.offsetDrawLine(0,8,-31,0,4,-35,251,14);
	mc.offsetDrawLine(0,4,-35,0,12,-43,251,14);
	mc.offsetDrawLine(0,12,-43,0,16,-39,251,14);
	mc.setVariable(x+50,y,z+50);
	}
} 

  

posted @ 2023-07-08 08:43  王ys  阅读(7)  评论(0编辑  收藏  举报