
Lv.1
无聊ING
在 岛3灵异事件 中回复
bugimgsrc="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-08T19:59:28 点赞:0
在 【box3】在章鱼游戏见到的 中回复
你这码打了个寂寞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-02-01T18:35:49 点赞:0
在 up计划第一期创作倒计时两个小时,加油! 中回复
有谁能一起做地图吗qwqhttps://box3.codemao.cn/e/c5ceb591d5c27031a33a
2022-02-12T18:28:38 点赞:0
在 【BOX3】岛三真的很吃显卡... 中回复
15帧的孩子笑笑不说话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_编程猫_搓头"
2022-03-02T19:22:44 点赞:0
在 【无聊发的】尹子速建整理 中回复
重新排版(555我的排版没了)
尹子的速建: 建筑速建
1.房屋https://shequ.codemao.cn/community/329519
2.参宿座战舰https://shequ.codemao.cn/community/324508
3.荷叶https://shequ.codemao.cn/community/319628
4.古风大庭子https://shequ.codemao.cn/community/362870
5.古风小亭子https://shequ.codemao.cn/community/330231
6.古风微亭子https://shequ.codemao.cn/community/391190
7.核弹https://shequ.codemao.cn/community/330528
8.樱花树https://shequ.codemao.cn/community/391664
9.复古天灯https://shequ.codemao.cn/community/391659
地形速建
1.沙漠https://shequ.codemao.cn/community/338477
2.滨海平原https://shequ.codemao.cn/community/331323
3.波浪山https://shequ.codemao.cn/community/331307
4.火山https://shequ.codemao.cn/community/392118
5.科喵多大峡谷https://shequ.codemao.cn/community/391897
6.雪原https://shequ.codemao.cn/community/391690
7.普普通通的地形https://shequ.codemao.cn/community/330726
2023-02-12T13:14:04 点赞:1
在 【求助】如何让实体跟随玩家运动 中回复
https://docs.box3.fun/code/skin.html#_02-%E5%8F%AF%E8%B7%9F%E9%9A%8F%E5%B0%8F%E7%B2%BE%E7%81%B5
2023-03-10T21:56:31 点赞:0
在 【求助】如何让实体跟随玩家运动 中回复
吉吉的宠物代码
console.clear()
const mscale = 1 / 16
const Quat = new Box3Quaternion(0, 0, 0, 1)
function buddyFollow(entity, mesh, y) {
const buddy = world.createEntity({
mesh,
position: entity.position,
meshScale: [mscale, mscale, mscale],
gravity: false, //不受重力影响
fixed: false, //可推移
collides: true, //可碰撞
friction: 0, //无摩擦力
mass: 0.01, //非常轻
})
const tgPos = entity.position//僚机的目标位置
const budPos = buddy.position//僚机的当前位置
const facing = entity.player.facingDirection//玩家的朝向
const ratio = 0.3//追随的灵敏度, 最好设在0.5左右, 1.0表示立即移到玩家位置
const dist = 2 //与玩家保持的距离
const yOffset = y //y轴位移, 保持僚机在头顶或脚下
const ticker = world.onTick(() => {
//要让小精灵跟在玩家背后, 需要计算xz轴的位移: 玩家朝向的反方向
const xOffset = -facing.x * dist
const zOffset = -facing.z * dist
//当前位置与目标位置在xyz轴的差距
const xDiff = tgPos.x - budPos.x
const yDiff = tgPos.y - budPos.y
const zDiff = tgPos.z - budPos.z
//计算xyz方向上 当前位置向目标位置靠拢的速度
const 喵 = (xDiff + xOffset) * ratio
const vy = (yDiff + yOffset) * ratio
const vz = (zDiff + zOffset) * ratio
buddy.velocity.set(喵, vy, vz)//设置僚机速度
if (buddy.velocity.sqrMag() > 0.005) {//速度要足够大, 才触发转向, 防止抖动
buddy.meshOrientation = Quat.rotateY(Math.atan2(zDiff, xDiff)) //让小精灵一直面向玩家
}
})
return () => {
ticker.cancel() //关掉tick循环
buddy.destroy() //移除僚机实体
}
}
world.onPlayerJoin(({ entity }) => {
entity.setPet = buddyFollow(entity, 'mesh/皮卡丘.vb', -1) //给玩家增加宠物
})
world.onPlayerLeave(({ entity }) => {
//玩家离开地图时, 切记一定要关掉tick循环以及销毁小精灵实体, 否则随着人数增加, 服务器积累到一定程度就会崩溃
entity.setPet() //干掉宠物
})2023-03-10T21:58:41 点赞:1
在 【无聊发的】尹子速建整理 中回复
重新排版(555我的排版没了)
尹子的速建: 建筑速建
1.房屋https://shequ.codemao.cn/community/329519
2.参宿座战舰https://shequ.codemao.cn/community/324508
3.荷叶https://shequ.codemao.cn/community/319628
4.古风大庭子https://shequ.codemao.cn/community/362870
5.古风小亭子https://shequ.codemao.cn/community/330231
6.古风微亭子https://shequ.codemao.cn/community/391190
7.核弹https://shequ.codemao.cn/community/330528
8.樱花树https://shequ.codemao.cn/community/391664
9.复古天灯https://shequ.codemao.cn/community/391659
地形速建
1.沙漠https://shequ.codemao.cn/community/338477
2.滨海平原https://shequ.codemao.cn/community/331323
3.波浪山https://shequ.codemao.cn/community/331307
4.火山https://shequ.codemao.cn/community/392118
5.科喵多大峡谷https://shequ.codemao.cn/community/391897
6.雪原https://shequ.codemao.cn/community/391690
7.普普通通的地形https://shequ.codemao.cn/community/330726
勿安速建整理(和楼主的结合着看
1:吉吉喵的头:shequ.codemao.cn/community/460413
2:现代装饰性建筑:shequ.codemao.cn/community/432996
3:神树:shequ.codemao.cn/community/429832
4:双层餐厅:shequ.codemao.cn/community/429327
5:体育场看台:shequ.codemao.cn/community/429325
2023-03-11T09:06:55 点赞:0
在 【box3】收藏帖の整理 中回复
欢迎投稿————————————————随时更新——————————————————
1.图形化https://box3.gitee.io/blockly/
2.跑酷教程https://shequ.codemao.cn/community/531670(随便说一下跑酷板子用动画更流畅())
——————————————————————————————————————————————————
2023-03-26T09:00:08 点赞:2