
Lv.1
不求当大佬,只求问心无愧box3老手玩我的世界3年多编程达人求No.1
签名:做box3地图 做作品 学习
在 我们一起创作吧,【金币多多】 中回复
https://box3create.codemao.cn/games/e75252796135cc749d77
2020-05-01T09:41:12 点赞:0
在 哈哈哈哈哈 中回复
enableDamage: boolean = true
showHealthBar: boolean = true
hp: number = 100
world.querySelectorAll('.test').forEach((e)=>{
var type='p';
world.onTick(()=>{
if(e.meshOrientation.x>=0.5){
e.meshOrientation.x-=0.1;
type='m';
} else if(e.meshOrientation.x<=-0.5){
e.meshOrientation.x+=0.1;
type='p';
} else{
if(type==='p'){
e.meshOrientation.x+=0.1;
} else{
e.meshOrientation.x-=0.1;
}
}
})
})
world.querySelectorAll('.test').forEach((e)=>{
var tick_times=0;
world.onTick(()=>{
tick_times++;
if(tick_times===1){
e.position.x+=1;
} else if(tick_times===3){
e.position.x+=1;
e.position.z+=1;
} else if(tick_times===5){
e.position.z+=1;
} else if(tick_times===7){
e.position.x-=1;
e.position.z+=1;
} else if(tick_times===9){
e.position.x-=1;
} else if(tick_times===11){
e.position.x-=1;
e.position.z-=1;
} else if(tick_times===13){
e.position.z-=1;
} else if(tick_times===15){
e.position.x+=1;
e.position.z-=1;
tick_times=0;
}
})
})
world.querySelectorAll('.狗').forEach((dog) => {
dog.onEntityContact(({other}) =>{
dog.say('汪,你好! '+other.player.name)
}
)
}
)
world.querySelectorAll('.3').forEach((e)=>{
var type='r';
world.onTick(()=>{
if(e.position.z>=11){
e.position.z-=0.3;
type='l';
} else if(e.position.z<=6){
e.position.z+=0.3;
type='r';
} else{
if(type==='r'){
e.position.z+=0.3;
} else{
e.position.z-=0.3;
}
}
})
})
const red_light = voxels.id('red_light');
voxels.setVoxelId(68, 8, 57, red_light);
enableDamage: boolean = true
showHealthBar: boolean = true
maxHp: number = 100
//随机摆放所有东西的位置
world.querySelectorAll('f').forEach((e) => {
e.position = new Box3Vector3(
Math.random()*100,
10+Math.random()*100,
Math.random()*100);
});
hp: number = 100
world.onPlayerJoin(({entity})=>{
entity.position.set(5, 9, 117);//玩家进来的时候,将ta传送到指定的坐标
entity.player.spawnPoint.copy(entity.position);//将玩家复活点复制为上面的坐标
})
world.onEntityContact(({entity,other})=>{
if(entity.isPlayer&&!other.isPlayer){
if(other.hasTag("start")&&entity.player.Pokering==false){
entity.player.Pokering=true;
}
if(other.hasTag("f")){
entity.player.Pokering=false;
var increase=Math.random()*10
world.say(`${entity.player.name}找到了空投!ta的攻击力增加了${increase}!`)
entity.player.emissive=true;
entity.player.attack+=increase;
entity.player.color=new Box3RGBColor(1,1,0)
entity.player.colorvariable=entity.player.color
entity.position.set(喵,20,喵)
//随机摆放所有东西的位置
world.querySelectorAll('f').forEach((e) => {
e.position = new Box3Vector3(
Math.random()*100,
10+Math.random()*100,
Math.random()*100);
});
}
}
})
world.onPlayerJoin(({ entity }) => {
entity.player.colorvariable=new Box3RGBColor(1,1,1)
entity.player.attack=5;
entity.player.Pokering=false;
entity.enableDamage = true;
entity.player.onPress(({ button, raycast:{ hitEntity, direction } }) => {
if (button !== 'action0' || !hitEntity) {
return;
}
if(!hitEntity.isPlayer){return}
hitEntity.velocity.x += direction.x;
hitEntity.velocity.y += 0.5;
hitEntity.velocity.z += direction.z;
hitEntity.hurt(entity.player.attack+Math.random()*5, {
attacker: entity,
});
});
});
world.onDie(({ entity, attacker }) => {
if (attacker) {
world.say(attacker.player.name + ' 无情KO了 ' + entity.player.name)
}
entity.player.spawnPoint.set(Math.random()*125,10,Math.random()*125)
entity.player.forceRespawn();
});
world.onTick(()=>{world.querySelectorAll('player').forEach((e)=>{
if(e.position.y<0){e.hurt(e.hp/10+1)}
})
})
world.onPress(({entity,button})=>{
if(button=="crouch"&&entity.hp<100&&!entity.player.Pokering){
if(entity.hp<98){
entity.hp+=2;
entity.player.color=new Box3RGBColor(0,1,0)
setTimeout(()=>{
entity.player.color=entity.player.colorvariable
},100)
}else{
entity.hp=100;
entity.player.color=new Box3RGBColor(0,1,0)
setTimeout(()=>{
entity.player.color=entity.player.colorvariable
},100)
}
}
})2020-05-08T13:58:49 点赞:0
在 哈哈哈哈哈 中回复
world.onTick(async({tick})=>{//重复执行!!!
world.querySelectorAll('.12').forEach((e)=>{//如果实体标签为“动车”
e.position.x+=3//z轴持续+3
if(e.position.x>120){//假如超过一定范围
e.position.x=0//把它抓回去!!
}
})//别忘了框架哦
})
world.onTick(async({tick})=>{//电梯代码
world.querySelectorAll('.555').forEach((e)=>{//如果实体标签为“动车”
e.position.y+=0.2//y轴持续+3
if(e.position.y>130){//假如超过一定范围
e.position.y=0//把它抓回去!!
}
})//别忘了框架哦
})
world.onEntityContact(({entity,other})=>{
if(entity.isPlayer===false){
if(other.isPlayer===true){
if(entity.hasTag('car')){
if(other.mesh===''){
other.meshOrientation = new Box3Quaternion(0, 1, 0, 0);//调整方向
other.mesh=entity.mesh;
other.meshScale=entity.meshScale;
other.player.canFly=false;
other.player.invisible=true;
other.player.walkSpeed=2;
other.player.runSpeed=3;
}
}
}
}
});2020-05-10T19:57:21 点赞:0
在 ——特大公告——CD工作室聊天室即将迎来巨大更新!! 中回复
https://www.qqxiuzi.cn/zh/caihongzi/index2.ht m 彩虹字体链接【注意:t m是连在一起滴】
2020-05-17T18:52:05 点赞:0
在 代码岛3.0围棋大赛 - 代码揭秘! 中回复
怎么使用啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊!!!!!!!!!!!!!!!!
谁到我地图里帮我搞啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊!!!!!!!!!!!!!!!!!头好晕...........
2020-06-01T15:06:54 点赞:0
在 55555555555555555555吉吉喵你好坏5555555555555555555 中回复
我的资格亚嗷嗷啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊55555555555555555



2020-06-04T20:09:38 点赞:0