
Lv.1
只活在神岛)一个连代码都不会写的人awa
签名:一个只活在神岛的入)
在 咦???呜?哇!!! 中回复
地图链接:dao3.fun/exp/experience/detail/100039468
各位可以去测试,有bug可以指出,我会尽力修复awa
2023-10-12T20:44:00 点赞:0
在 【box3】可能是第一个跑酷比赛代码模板(最新版 中回复
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_编程猫_点赞"
2023-10-13T13:06:17 点赞:1
在 如何上首页?我正在制作一个叫狼人躲猫猫的地图,我想让这个地图上首页,如何上首页呢?谁来教教我 中回复
你可以呢,把你的地图链接、玩法、地图亮点发给吉吉,吉吉会给你一些建议,按照这些建议去改,说不定可以上首页了
2023-10-27T21:28:00 点赞:2
在 【box3】如何发射子弹 中回复
代码如下:(注:模型要和模型名字一样,不然会报错)
world.addCollisionFilter('player', '.子弹')
//首先先导入一个子弹的模型,为0,0,0,1的默认角度
//子弹创建代码:
console.clear()
async function shoot(entity = new GameEntity) {
var speed = 5;//越大越快
const e = world.createEntity({
mesh: 'mesh/子弹.vb',//其实未必要子弹,弓箭啥一样的
meshScale: new GameVector3(0.0625, 0.0625, 0.0625),//自己调整
gravity: false, //通过代码控制,而不是使用自带的
collides: true,//也是使用代码控制,防止打到墙壁会反弹,使用代码还可以有一点穿透效果
position: entity.position,
})
e.speed = speed
e.own = entity
e.addTag('子弹')
var angle = Math.atan2(entity.player.facingDirection.z, entity.player.facingDirection.x)
//敲重点:
e.velocity.set(
Math.cos(angle) * Math.cos(-entity.player.cameraPitch) * speed,
Math.sin(-entity.player.cameraPitch) * speed,
Math.sin(angle) * Math.cos(-entity.player.cameraPitch) * speed,
)
e.meshOrientation = new GameQuaternion(0, 0, 0, 1).rotateX(
Math.atan2(e.velocity.y, Math.sqrt(e.velocity.x ** 2 + e.velocity.z ** 2))
).rotateY(angle)
e.onVoxelContact(() => {
e.destroy()
})
await sleep(5000);
//10秒后消失,防止太多飞出边界
e.destroy()
}
world.onPress(async ({ entity, button, raycast }) => {
if (button == GameButtonType.ACTION0) {
while (entity.player.action0Button) {//连射
shoot(entity)
await sleep(100)//连射间隔,自己定
}
}
});
(async function () {//主循环
while (1) {
world.querySelectorAll('.子弹').forEach((e) => {
var angle = Math.atan2(e.velocity.z, e.velocity.x)
var up = Math.atan2(e.velocity.y, Math.sqrt(e.velocity.x ** 2 + e.velocity.z ** 2))
e.meshOrientation = new GameQuaternion(0, 0, 0, 1).rotateX(
up
).rotateY(
angle
)
e.velocity.y -= 0.1//重力下垂
var hitBox = new GameBounds3(e.position.sub(e.bounds), e.position.add(e.bounds));
var hitEntities = world.querySelectorAll('*').filter(a => hitBox.intersects(new GameBounds3(a.position.sub(a.bounds), a.position.add(a.bounds))))
for (let entity of hitEntities) {
e.onEntityContact(({ other }) => {
if (other.isPlayer) {
Die(other)
}
})
}
})
await sleep(100)
}
})()2023-11-11T20:32:58 点赞:0
在 怎么做挂机检测? 中回复
代码如下:(超过一定的时间会自动踢出地图,entity.guaji是变量,当然你也可以在论坛上搜,如果是新编辑器把Box3改成Game,免得报错) world.onPlayerJoin(({entity})=>{ entity.guaji=0 world.onTick(()=>{ if(entity.player.walkState==Box喵layerWalkState.NONE){//如果玩家没运动 entity.guaji+=1 }else{ entity.guaji=0 } if(entity.guaji==60*16*10){//1000/喵表示1秒内有16个tick(估算),60表示判定秒数 entity.player.dialog({ type:Box3DialogType.TEXT, content:'你已挂机10分钟,请重进游戏!', title:'系统' }) entity.player.kick() } }) })
2023-11-11T20:37:37 点赞:0
在 水烨全新新图《神岛村规则怪谈》来啦! 中回复
地图链接:https://dao3.fun/exp/experience/detail/100078303 别问我为啥不放正文,因为吞格式(
2023-11-22T13:30:13 点赞:0