
Lv.1
Everything happens for a reason.
签名:https://box3.codemao.cn/u/YDSyinzi
在 【Python作品分享】新的作品【作品秀】 中回复
function boom(pos,r){
for(let i=pos.x-r;i<=pos.x+r;i++){
for(let j=pos.z-r;j<=pos.z+r;j++){
for(let k=pos.y-r;k<=pos.y+r;k++){
if(new Box3Vector3(i,k,j).distance(pos)<=r){
var force=Math.pow(new Box3Vector3(i,k,j).distance(pos),0.5)*0.3;
if(Math.random()*force<1){
voxels.setVoxel(i,k,j,0);
}
}
}
}
}
}
world.onPlayerJoin(({entity})=>{
entity.addTag(entity.player.name);
entity.enableDamage=true;
})
world.onPress(async({entity,button})=>{
if(button=="action0"){
var f=3;
a=world.createEntity();
a.mesh=world.querySelector(".pd").mesh;
a.meshScale=world.querySelector(".pd").meshScale;
a.addTag("bullet");
a.owner=entity.player.name;
a.position.set(entity.position.x,entity.position.y+1.5,entity.position.z);
a.collides=true;
a.restitution=1;
a.fixed=false;
a.gravity=true;
var angx=Math.asin(entity.player.facingDirection.x)*180/Math.PI;
var angz=Math.acos(entity.player.facingDirection.z)*180/Math.PI;
a.velocity.x=f*Math.sin(angx*Math.PI/180);
a.velocity.z=f*Math.cos(angz*Math.PI/180);
a.velocity.y=0.3;
setTimeout(()=>{
a.destroy();
},2000)
}
})
world.onEntityContact(({entity,other})=>{
if(entity.isPlayer&&other.hasTag("bullet")){
entity.hurt(10);
entity.dreason="被炮弹砸喵了";
other.destroy()
}
})
world.onVoxelContact(({entity})=>{
if(entity.hasTag("bullet")&&!entity.isPlayer){
setTimeout(()=>{
boom(entity.position,5)
entity.destroy();
},1000)
}
})2020-08-16T11:56:58 点赞:0
在 急啊,BOX3这怎么做出来的????? 中回复
world.onPlayerJoin(({ entity }) => {
entity.player.enable3DCursor = true;
})2020-08-16T18:58:56 点赞:1
在 【举报】被毁图!望岛民转发让大家都来揭发按毁图者的恶行! 中回复
分享一份情报
---------血衣族----------
邪恶的血衣(啊,爱代码岛):
id:
box3id:3472873
热爱编程猫代码岛合格岛民:
id:10133533
box3id:7183359
战神_小火熊_:
id:
box3id:6710617
匛膩深婧惢魢唥(江紫衣):
id:
box3id:7982811
2020-08-18T07:00:31 点赞:0