其他分享
首页 > 其他分享> > MC举剑him代码

MC举剑him代码

作者:互联网

#include <iostream>
#include <string> 
#include "minecraft.h"
#include "mc.cpp"
using namespace std;
TxMinecraft mc;
int main(int argc, char** argv) {
	bool con=mc.ConnectMinecraft("tk.makeblock.net.cn","a9d44e758f6e4cf8b2da2624156f24d3");
	if(!con){
		cout<<"连接失败";
		return 0;
	}
	cout<<"连接成功";
	int x,y,z,id=251;
	
	cout<<"请输入坐标,空格分隔"<<endl; 
	cin>>x>>y>>z;
	//手臂 
	for(int i=0;i<16;i++){
		if(i<4&&i>-1||i<16&&i>11){
			mc.drawLine(x+i,y+21,z,x+i,y+24,z,251,7);
		}
	}
	//右臂 
	for(int i=12;i<21;i++){
		mc.drawLine(x+0,y+i,z,x+3,y+i,z,251,8);	
	}
	//左臂 
	for(int i=16;i<25;i++){
		mc.drawLine(x+i,y+21,z,x+i,y+24,z,251,8);	
	}
	//身体 
	for(int i=0;i<12;i++){
		if(i<12&&i>3){
			mc.drawLine(x+i,y+12,z,x+i,y+24,z,251,11);
		}
	}	
	mc.drawLine(x+6,y+24,z,x+9,y+24,z,251,7);
	mc.drawLine(x+7,y+23,z,x+8,y+23,z,251,7);
	//腿		
	mc.drawLine(x+5,y+12,z,x+11,y+12,z,251,7);
	mc.drawLine(x+6,y+13,z,x+11,y+13,z,251,7);
	for(int i=2;i<12;i++){
		mc.drawLine(x+4,y+i,z,x+7,y+i,z,251,7);	
	}	
	mc.drawLine(x+4,y+0,z,x+7,y+0,z,251,8);
	mc.drawLine(x+4,y+1,z,x+7,y+1,z,251,8);
	for(int i=10;i<18;i++){
		mc.drawLine(x+10,y+i,z,x+13,y+i,z,251,7);	
	}	
	mc.drawLine(x+10,y+9,z,x+13,y+9,z,251,8);
	mc.drawLine(x+10,y+8,z,x+13,y+8,z,251,8);
	//头		
	for(int i=0;i<12;i++){
		if(i<12&&i>3){
			mc.drawLine(x+i,y+25,z,x+i,y+32,z,251,7);
		}
	}
	for(int i=0;i<12;i++){
		if(i<12&&i>3){
			mc.drawLine(x+i,y+31,z,x+i,y+32,z,251,4);
		}
	}
	mc.setBlock(x+11,y+30,z,251,4);
	mc.setBlock(x+4,y+30,z,251,4);
	mc.setBlock(x+8,y+27,z,251,4);
	mc.setBlock(x+7,y+27,z,251,4);
	mc.setBlock(x+9,y+26,z,251,4);
	mc.setBlock(x+9,y+25,z,251,4);
	mc.setBlock(x+6,y+26,z,251,4);
	mc.setBlock(x+6,y+25,z,251,4);
	mc.drawLine(x+7,y+25,z,x+8,y+25,z,251,4);
	mc.drawLine(x+10,y+28,z,x+9,y+28,z,251,0);
	mc.drawLine(x+5,y+28,z,x+6,y+28,z,251,0);	
	//苦力怕 
	for(int i=0;i<8;i++){
		mc.drawLine(x+8,y+i,z,x+15,y+i,z,251,13);	
	}	
	for(int i=0;i<16;i++){
		if(i<11&&i>8||i<15&&i>12){
			mc.drawLine(x+i,y+5,z,x+i,y+6,z,251,7);
		}
	}	
	mc.drawLine(x+11,y+4,z,x+12,y+4,z,251,7);
	mc.drawLine(x+10,y+3,z,x+13,y+3,z,251,7);
	mc.drawLine(x+10,y+2,z,x+13,y+2,z,251,7);
	mc.setBlock(x+10,y+1,z,251,7);
	mc.setBlock(x+13,y+1,z,251,7);
	//剑 
	mc.drawLine(x+19,y+20,z,x+23,y+24,z,251,7);
	mc.drawLine(x+20,y+19,z,x+24,y+23,z,251,7);
	mc.drawLine(x+24,y+26,z,x+33,y+35,z,251,7);
	mc.drawLine(x+26,y+24,z,x+35,y+33,z,251,7);
	mc.drawLine(x+25,y+26,z,x+33,y+34,z,251,0);
	mc.drawLine(x+26,y+25,z,x+34,y+33,z,251,0);	
	mc.setBlock(x+20,y+20,z,251,11);
	mc.drawLine(x+21,y+21,z,x+23,y+23,z,251,0);	
	mc.setBlock(x+19,y+19,z,251,7);
	mc.setBlock(x+34,y+35,z,251,7);
	mc.setBlock(x+35,y+35,z,251,7);
	mc.setBlock(x+35,y+34,z,251,7);
	mc.setBlock(x+22,y+25,z,251,7);
	mc.setBlock(x+25,y+22,z,251,7);
	mc.setBlock(x+21,y+28,z,251,7);
	mc.setBlock(x+28,y+21,z,251,7);
	mc.drawLine(x+28,y+22,z,x+22,y+28,z,251,7);
	mc.drawLine(x+27,y+22,z,x+22,y+27,z,251,11);
	mc.drawLine(x+27,y+21,z,x+21,y+27,z,251,11);
	mc.drawLine(x+25,y+25,z,x+34,y+34,z,251,1);
	return 0;
}

 

标签:24,25,MC,mc,drawLine,举剑,setBlock,251,him
来源: https://www.cnblogs.com/wangyueshuo/p/16685481.html