Lv.1
一个满级野生双职业Box3er
签名:嗷嗷嗷
在 【岛3漫游指南】:你是怎样,岛3就是怎样! 中回复
imgsrc="https://static.codemao.cn/emotion/star_cat/%E5%93%BC.gif"alt="emotion_星能猫_哼"
2021-12-02T10:22:43 点赞:0
在 【每日一个岛3建图小技巧】弹跳装置和加速器,跑酷必备! 中回复
imgsrc="https://static.cod喵/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E5%86%B7%E6%BC%A0.gif"alt="emotion_编程猫_冷漠"
2021-12-15T13:52:36 点赞:0
在 圣诞创作节下半场倒计时1天,加油! 中回复
能不能在简介中输入参赛标语,题目根本写不下imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E6%90%93%E5%A4%B4.gif"alt="emotion_编程猫_搓头"
2021-12-20T10:34:45 点赞:0
在 【每日一个岛3建图小技巧】如何制造大范围伤害? 中回复
所以这串代码哪里错了 function killZone(pos, radius, fn) { //球状AOE for (const e of world.querySelectorAll('*')) {//遍历所有实体 const dist = e.position.distance(pos)//计算作用点与当前实体的距离 if (dist <= radius) {//当距离小于等于有效作用半径 fn(e, dist)//传递当前实体和距离到回调函数并执行 } } }
async function killBox(pos, size, fn) { //盒状AOE //搜索包围盒内的所有实体 const entities = world.searchBox({ lo: [pos.x - size, pos.y - size, pos.z - size], //包围盒下边界 hi: [pos.x + size, pos.y + size, pos.z + size], //包围盒上边界 })
for (const e of entities) { //遍历所有找到的实体 fn(e) } }
async function makeDamage(e, dmg, color) { e.hurt(Math.max(1, dmg)) //max用于防止负数伤害
e.meshColor.copy(color) //当前实体变色 await sleep(500) e.meshColor.set(1, 1, 1, 1) //恢复正常颜色 }
const RED = new Box3RGBAColor(1, 0, 0, 1) const GREEN = new Box3RGBAColor(0, 1, 0, 1) const BLUE = new Box3RGBAColor(0, 0, 1, 1) var aoe = 1 world.onPlayerJoin(({ entity }) => { entity.player.onPress(async ({ button }) => { if (button == Box3ButtonType.ACTION1) { let sel = await entity.player.dialog({ type: Box3DialogType.SELECT, content: '选择AOE', options: ['自身', '球状', '盒子',] })
if(sel.value === '自身'){ aoe = 1 } if(sel.value === '球状'){ aoe = 2 } else{ aoe = 3 } }
else if(button == Box3ButtonType.ACTION0) { if(aoe === 1){ const range = 8//AOE有效作用半径 killZone(entity.position, range, async (e, dist) => { if (e === entity) return//如果当前实体是AOE施放者, 就不继续执行, 避免伤到自己 const ratio = (range - dist) / range //计算距离百分比, 离得越近ratio越趋向1, 离得越远ratio越趋向0 makeDamage(e, 100 * ratio, RED) }) }
else if(aoe === 2){ const range = 8//AOE有效作用半径 killZone(raycast.hitPosition, range, async (e, dist) => { if (e === entity) return//如果当前实体是AOE施放者, 就不继续执行, 避免伤到自己 const ratio = (range - dist) / range //计算距离百分比, 离得越近ratio越趋向1, 离得越远ratio越趋向0 makeDamage(e, 100 * ratio, GREEN) }) }
else{ const size = 7 //AOE盒的大小 killBox(raycast.hitPosition, size, (e) => { if (e === entity) return//如果当前实体是AOE施放者, 就不继续执行, 避免伤到自己 makeDamage(e, 20, BLUE) }) } } }) })
2022-01-11T20:13:17 点赞:0
在 up计划第一期创作倒计时两个小时,加油! 中回复
感谢吉吉喵高看我,水了几个地图就不是萌新了imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E6%BA%9C%E4%BA%86%E6%BA%9C%E4%BA%86.gif"alt="emotion_编程猫_溜了溜了"
2022-01-21T08:40:48 点赞:0
在 【岛3教程】SQL时间排行榜注释版! 中回复
你这个有一些问题(我没运行过,要是说错了记得指出),首先,如果多次碰到终点线会被多次记录,应该加一个判定,如果玩家是第一次碰到终点线才会被记录。 然后,函数:topDialog中对话框是select选择对话框形式,而R是选择钮,正文则是空的。应该改成text文本对话框,并把正文设置为R。 不过整体来说还是很棒的imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E7%82%B9%E8%B5%9E.gif"alt="emotion_编程猫_点赞"
2022-03-14T15:30:20 点赞:0
在 代码求助! 中回复
imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E6%BA%9C%E4%BA%86%E6%BA%9C%E4%BA%86.gif"alt="emotion_编程猫_溜了溜了"
2022-03-18T08:38:04 点赞:0
在 教程师计划第二期:阿吉在召唤! 中回复
吉吉喵,代码教程师的地图链接是地图链接还是合作链接啊 imgsrc="https://static.codemao.cn/emoji/codemao/%E7%BC%96%E7%A8%8B%E7%8C%AB_%E8%B0%A2%E8%B0%A2%E8%80%81%E6%9D%BF.gif"alt="emotion_编程猫_谢谢老板"width="47"height="47"
2022-03-18T15:11:46 点赞:1