用户:
小玥玥小月月查看:4 回复:6 评论:4 创建时间:2020-12-25T19:34:06
如题…………………………
荷花编程world.querySelectorAll('.起点').forEach((e)=>{
e.meshEmissive=0;
e.onEntityContact(({entity,other})=>{
if(other.player.Start==false){
world.say(other.player.name+'出发了!');
other.player.Start=true;
other.player.canFly = false
other.player.runSpeed = 0.4
other.player.spawnPoint.copy(other.position);
}
})
})
world.querySelectorAll('.存档').forEach((e)=>{
e.meshEmissive=0;
e.onEntityContact(({entity,other})=>{
if(other.player.Start==true){
world.say(other.player.name+'存档成功!');
other.player.spawnPoint.copy(other.position);
}
})
})
world.querySelectorAll('.终点').forEach((e)=>{
e.meshEmissive=0;
e.onEntityContact(({entity,other})=>{
if(other.player.Start==true){
world.say(other.player.name+'到达了终点,获得飞行权限!');
other.player.spawnPoint.copy(other.position);
other.player.Start = false
other.player.canFly = true
}
})
})点赞1
评论
卫道士32_32*2没了const quanxian={canFly:true};
world.onPlayerJoin(({entity})=>{
entity.isRun=false;
entity.backupPosition=new Box3Vector3(55,55,55);//你的跑酷的初始存档点
});
world.querySelector('.起点').onEntityContact(({entity,other})=>{
entity.say(`${other.player.name}出发了。`);
other.isRun=true;
other.position.copy(other.backupPosition.clone());
});
world.querySelectorAll('.存档点').forEach(x=>{
x.onEntityContact(({entity,other})=>{
if(other.isRun){
entity.say(`${other.player.name}跑到了${x.id}关。`);
other.backupPosition.copy(new Box3Vector3(other.position.x,other.position.y+other.bounds.y/2,other.position.z));
}else{
entity.say(`对付什么呀?!@${other.player.name}重跑吧!`);
other.position.copy(other.backupPosition);
}
});
});
world.querySelector('.终点').onEntityContact(({entity,other})=>{
if(other.isRun){
entity.say(`${other.player.name}跑完了全程。`);
Object.assign(other.player,quanxian);
}else{
entity.say(`对付什么呀?!@${other.player.name}重跑吧!`);
other.position.copy(other.backupPosition);
}
});
点赞1
评论