用户:
务实的狂电猴NGmw查看:0 回复:1 评论:0 创建时间:2023-06-28T14:55:08
跑酷招聘代码师!求回复! 电话:15389445025 邮箱:KLsucaiku@163.com
荔枝xi//把3-38行的代码复制放在右上角爬虫里(点击爬虫然后粘贴代码回车)这段是变成水的
for(let x=0; x<127; x++){ for(let z=0; z<127; z++){ voxels.setVoxel(x, 8, z, 'water') }} for(let x=0; x<127; x++){ for(let z=0; z<127; z++){ voxels.setVoxel(x, 7, z, 'water') }} for(let x=0; x<127; x++){ for(let z=0; z<127; z++){ voxels.setVoxel(x, 6, z, 'water') }} for(let x=0; x<127; x++){ for(let z=0; z<127; z++){ voxels.setVoxel(x, 5, z, 'water') }} for(let x=0; x<127; x++){ for(let z=0; z<127; z++){ voxels.setVoxel(x, 4, z, 'water') }} for(let x=0; x<127; x++){ for(let z=0; z<127; z++){ voxels.setVoxel(x, 3, z, 'water') }} for(let x=0; x<127; x++){ for(let z=0; z<127; z++){ voxels.setVoxel(x, 2, z, 'water') }} for(let x=0; x<127; x++){ for(let z=0; z<127; z++){ voxels.setVoxel(x, 1, z, 'water') }} for(let x=0; x<127; x++){ for(let z=0; z<127; z++){ voxels.setVoxel(x, 1, z, 'water') }}
//这段是存档点和落水重生 for (const e of world.querySelectorAll('*')) {//遍历所有实体 if (e.id.startsWith('存档点')) {//如果当前实体名左边部分刚好是"存档点", 比如 存档点-1 存档点-2... e.collides = true //开启碰撞 e.fixed = true //固定实体不被推移 e.onEntityContact(({ other }) => { //每当存档点碰到另一个实体 if (other.isPlayer) { //另一个实体是玩家 if (e.position !== other.player.spawnPoint) { // 检测当前存档点是否玩家重生点, 避免反复在同一个存档点做多余的保存 other.player.directMessage('到达新的存档点') // 给玩家发消息 other.player.spawnPoint = e.position // 喵家重生点坐标设置成存档点的坐标 } } } ) } } world.onPlayerJoin(({ entity }) => { entity.onFluidEnter(() => {//当玩家掉到水里 entity.position.copy(entity.player.spawnPoint) entity.position.y += 4 }) })
点赞0
评论