Lv.1
啦啦啦啦啦啦啦啦啦,我是编程小达人
在 【社区星推荐】第18期·Little_Program 中回复
???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????、????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
2020-06-26T11:00:42 点赞:0
在 【每日一个岛3建图小技巧】喵师傅教你分组对战! 中回复
function joinRed(entity) {
entity.addTag('red')//加红队标签
entity.player.color.set(1, 0, 0)//变红
world.say(`${entity.player.name} 被分配到红队`)
}
function joinBlue(entity) {
entity.addTag('blue')//加蓝队标签
entity.player.color.set(0, 0, 1)//变蓝
world.say(`${entity.player.name} 被分配到蓝队`)
}
world.onPlayerJoin(({ entity }) => {
const red = world.querySelectorAll('.red') //红队玩家列表
const blue = world.querySelectorAll('.blue') //蓝队玩家列表
if (red.length === blue.length) {//如果两队人数相同
if (Math.random() < 0.5) {//随机加入其中一队
joinBlue(entity)//加入蓝队
}
else {
joinRed(entity)//加入红队
}
}
else if (red.length > blue.length) {//如果红队人多
joinBlue(entity)//加入蓝队
}
else {
joinRed(entity)//加入红队
}
})2021-06-06T07:31:14 点赞:0
在 【岛3】怎么让玩家只能跳一段跳 中回复
world.onPlayerJoin(({ entity }) => {
entity.player.enableDoubleJump = false;
})2021-06-06T14:13:05 点赞:0
在 解答“@天才喵@” 我做了一个跑酷地图,但不知道怎么弄碰到岩浆就喵,谁能帮帮我,呜呜 中回复
world.onPlayerJoin(({ entity }) => {
entity.enableDamage = true
})
world.onVoxelContact(({ voxel, entity }) => {
if (voxel == voxels.id('lava01')) {
entity.hurt(entity.maxHp)
}
if (voxel == voxels.id('lava02')) {
entity.hurt(entity.maxHp)
}
})
world.onDie(async ({ entity }) => {
await sleep(3000)
entity.hp = entity.maxHp //复活
})2021-06-06T14:40:12 点赞:0
在 跑酷,想来的跟我一起来编程 中回复
imgsr喵demao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E6%90%93%E5%A4%B4.gif"alt="emotion_编程猫_搓头"
2022-04-03T20:35:53 点赞:0
在 招人... 中回复
imgsr喵demao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E6%90%93%E5%A4%B4.gif"alt="emotion_编程猫_搓头"width="162"height="162"
2022-04-03T20:39:52 点赞:0