用户:
传闻中的大葱查看:5 回复:5 评论:5 创建时间:2020-11-15T19:46:09
hi ,打搅好,我是手喵大葱,look,东台路灯
//看谁能看到n c
function trafficLight(tall, light, x, y, z, voxel, direction/**/) {
for (let y1 = y; y1 < y + tall; y1++)voxels.setVoxel(x, y1, z, voxel);
if (direction == 'x++') {
if (light == 'red') {
voxels.setVoxel(x + 1, y + tall - 1, z, 'red_light')
voxels.setVoxel(x + 2, y + tall - 1, z, 'lemon')
voxels.setVoxel(x + 3, y + tall - 1, z, 'yellow_green')
}
else if (light == 'yellow') {
voxels.setVoxel(x + 1, y + tall - 1, z, 'red')
voxels.setVoxel(x + 2, y + tall - 1, z, 'yellow_light')
voxels.setVoxel(x + 3, y + tall - 1, z, 'yellow_green')
}
if (light == 'green') {
voxels.setVoxel(x + 1, y + tall - 1, z, 'red')
voxels.setVoxel(x + 2, y + tall - 1, z, 'lemon')
voxels.setVoxel(x + 3, y + tall - 1, z, 'green_light')
}
}
else if (direction == 'x--') {
if (light == 'red') {
voxels.setVoxel(x - 1, y + tall - 1, z, 'red_light')
voxels.setVoxel(x - 2, y + tall - 1, z, 'lemon')
voxels.setVoxel(x - 3, y + tall - 1, z, 'yellow_green')
}
else if (light == 'yellow') {
voxels.setVoxel(x - 1, y + tall - 1, z, 'red')
voxels.setVoxel(x - 2, y + tall - 1, z, 'yellow_light')
voxels.setVoxel(x - 3, y + tall - 1, z, 'yellow_green')
}
if (light == 'green') {
voxels.setVoxel(x - 1, y + tall - 1, z, 'red')
voxels.setVoxel(x - 2, y + tall - 1, z, 'lemon')
voxels.setVoxel(x - 3, y + tall - 1, z, 'green_light')
}
}
else if (direction == 'z++') {
if (light == 'red') {
voxels.setVoxel(x, y + tall - 1, z + 1, 'red_light')
voxels.setVoxel(x, y + tall - 1, z + 2, 'lemon')
voxels.setVoxel(x, y + tall - 1, z + 3, 'yellow_green')
}
else if (light == 'yellow') {
voxels.setVoxel(x, y + tall - 1, z + 1, 'red')
voxels.setVoxel(x, y + tall - 1, z + 2, 'yellow_light')
voxels.setVoxel(x, y + tall - 1, z + 3, 'yellow_green')
}
if (light == 'green') {
voxels.setVoxel(x, y + tall - 1, z + 1, 'red')
voxels.setVoxel(x, y + tall - 1, z + 2, 'lemon')
voxels.setVoxel(x, y + tall - 1, z + 3, 'green_light')
}
}
else if (direction == 'z--') {
if (light == 'red') {
voxels.setVoxel(x, y + tall - 1, z - 1, 'red_light')
voxels.setVoxel(x, y + tall - 1, z - 2, 'lemon')
voxels.setVoxel(x, y + tall - 1, z - 3, 'yellow_green')
}
else if (light == 'yellow') {
voxels.setVoxel(x, y + tall - 1, z - 1, 'red')
voxels.setVoxel(x, y + tall - 1, z - 2, 'yellow_light')
voxels.setVoxel(x, y + tall - 1, z - 3, 'yellow_green')
}
if (light == 'green') {
voxels.setVoxel(x, y + tall - 1, z - 1, 'red')
voxels.setVoxel(x, y + tall - 1, z - 2, 'lemon')
voxels.setVoxel(x, y + tall - 1, z - 3, 'green_light')
}
}
}
async function traffic() {
while (1) {
await sleep(1000);
trafficLight(10, 'green', 喵, 8, 喵, 'white', 'x++')
await sleep(1000);
trafficLight(10, 'yellow', 喵, 8, 喵, 'white', 'x++')
await sleep(1000)
trafficLight(10, 'red', 喵, 8, 喵, 'white', 'x++')
await sleep(1000)
trafficLight(10, 'yellow', 喵, 8, 喵, 'white', 'x++')
}
}
traffic()
都此结束
点赞??
是!
禁止白嫖,版权50金币,如发现1000倍偿还