猫史档案馆


AB骉Alobok

AB骉Alobok

Lv.1

QQ:3346223415

获赞:424收藏:162浏览:5730作品收藏:208

签名:我正在做‘原始枪战’这个可能会上首页但是没有联机可能需要花费好几天的时间希望大家可以喜欢!这个作品点赞过10更新,点赞过100开源全代码(或者收藏过50),这个作品我换了2次才可以的,球球了! (*╯3╰)把你们手上的赞都给我吧!点赞收藏过500或者关注我就把我的所有粉丝关注一遍!FQ不可能(╯▽╰)我的点赞不可能那么多我可能想多了……我现在长期在box3代码岛里玩所以我可能以后的作品会拖更的...

回复帖子评论
上一页2 页 / 共 12下一页

【社区星推荐】第53期·技术狗&史莱姆yyds! 中回复

emotion_编程猫_翻白眼

2021-04-10T12:56:35 点赞:0

【社区星推荐】第53期·技术狗&史莱姆yyds! 中回复

emotion_编程猫_厉害了恭喜,恭喜Thanks♪(・ω・)ノ!!!!!!!!!!!!!!!emotion_编程猫_厉害了emotion_编程猫_厉害了

2021-04-11T17:03:50 点赞:0

代码岛我疼 发!不!了! 中回复

发!不!了!emotion_编程猫_伤心

2021-04-20T19:41:07 点赞:0

代码岛我疼 发!不!了! 中回复

emotion_编程猫_搓头

2021-04-21T17:55:54 点赞:0

代码岛我疼 发!不!了! 中回复

2021-04-21T17:57:06 点赞:0

代码岛我疼 发!不!了! 中回复

Cemotion_编程猫_搓头发!不!了!

2021-04-21T17:59:08 点赞:0

【岛3老活新整创作节】官方地图《赤碧城》限时送,报名时间已截止! 中回复

我要报名参赛,我的编辑地址是:https://box3.codemao.cn/e/3a1579bb6fdcde63062d

2021-04-29T17:39:34 点赞:0

【岛3大新闻】老活新整创作节报名截止,比赛启动! 中回复

(~ ̄(OO) ̄)ブ

2021-04-30T16:09:14 点赞:0

【岛3大新闻】老活新整创作节报名截止,比赛启动! 中回复

emotion_雷电猴_哇噻

2021-04-30T16:09:36 点赞:0

【岛3大新闻】老活新整创作节报名截止,比赛启动! 中回复

吉吉猫看看我的作品!https://box3.codemao.cn/e/3a1579bb6fdcde63062d

2021-04-30T16:34:14 点赞:0

【岛3大更新】你最想要的那个功能来了! 中回复

发发发发发发付付付付付付付付付付付付付付付付付付付付付付付付付付付付付付

2021-05-04T17:39:00 点赞:0

5月玩什么?在资源紧缺的世界末日,如何生存到最后…… 中回复

XZA红木工Z顷ZAS 经A

2021-05-11T17:35:27 点赞:0

5月玩什么?在资源紧缺的世界末日,如何生存到最后…… 中回复

#恐怖游戏#

2021-05-14T20:12:16 点赞:0

5月玩什么?在资源紧缺的世界末日,如何生存到最后…… 中回复

#

2021-05-14T20:13:29 点赞:0

谁才是究极整活冠军?《赤碧城》老活新整获奖名单公布 中回复

我490行代码https://box3.codemao.cn/e/5b0b1573562b5f11ae74?p=DvM3xIaQegVzrYDilXQFOJsHzyTziHYs4lMBLSnv5HA8X7xn2WLwVndWVzdA%3D%3D

2021-05-14T21:20:33 点赞:0

【岛3漫游指南】:你是怎样,岛3就是怎样! 中回复

https://box3.codemao.cn/e/5b0b157356喵5f11ae74

2021-05-16T12:57:53 点赞:0

【代码岛3.0编辑器】萌新教程第1期 - 地图篇! 中回复

其实还可以飞!

2021-05-16T14:13:47 点赞:0

【久违的API系列教程】来啊,互相伤害吧! 中回复

console.clear();
world.onPlayerJoin(({ entity }) => {
    entity.enableDamage = true; /*允许这个实体 受伤/喵亡/复活*/
    entity.id = entity.player.name; /*把 玩家名字赋值到id, 以便和其它实体一样可以统一通过entity.id获取名字*/
});


world.onVoxelContact(({ entity, voxel }) => {
    const voxelName = voxels.name(voxel);
    if (voxelName === 'lava02'){
        entity.hurt(30,{
            damageType: '火焰', /*伤害类型为火焰*/
        });
    };
    if (voxelName === 'ice'){
        entity.hurt(20,{
            damageType: '冰冻', /*伤害类型为冰冻*/
        });
    };
});


world.onTakeDamage(({ entity, damage, damageType}) => {
    world.say(`${entity.id} 受到了 ${damage}点${damageType}伤害`);
});

for (const e of world.querySelectorAll('.1')) { //遍历每个僵尸实体
    e.enableDamage = true //允许这个实体 受伤/喵亡/复活
    e.collides = true //允许实体被碰撞
    e.gravity = true //开启重力, 这样实体才不会一碰就飘走
}

world.onPlayerJoin(({ entity }) => {
    entity.enableDamage = true //允许这个实体 受伤/喵亡/复活
    entity.id = entity.player.name //玩家名字赋值到id, 以便和其它实体一样可以统一通过entity.id获取名字
})

world.onEntityContact(({ entity, other }) => {
    if (other.id.startsWith('僵尸')) { //如果被碰实体有僵尸标签
        entity.hurt(30, {
            damageType: '病毒', //伤害类型为病毒
            attacker: other, //告诉引擎攻击者是被碰到的这个实体
        })
    }
})

world.onClick(({ entity, clicker }) => {// entity是被点击的实体, clicker是点击了这个实体的玩家
    entity.hurt(20, {
        damageType: '喵击', //伤害类型为喵击
        attacker: clicker, //告诉引擎攻击者是触发点击的这个玩家实体
    })
})

world.onDie(({ entity, attacker, damageType }) => { //每次地图里有实体喵亡
    if (entity.isPlayer) { //如果是玩家实体
        if (damageType === '病毒') { //如果是病毒致喵
            entity.player.color.set(0, 1, 0) //玩家实体颜色变绿
        }
    } else { //如果非玩家实体
        if (damageType === '喵击') { //如果是喵击致喵
            entity.destroy() //从地图上消失
        }
    }
})

const lava_hurt=[465,467]//触碰时被岩浆伤害的指定方块
const ice_hurt=[398,347]//触碰时被冰伤害的指定方块
const poison_hurt=[99,101]//懒得说了
world.onPlayerJoin(({entity:e/*将entity重命名为e*/})=>{
    e.enableDamage=true//别忘了这玩意!
    e.onVoxelContact(({x,y,z})=>{//这里onVoxelContect()必须嵌在onPlayerJoin里,否则所有实体碰到都会被伤害
        const vox = voxels.getVoxelId(x,y,z)
        if(lava_hurt.includes(vox)){//includes函数可以判断lava_hurt方块中是否包括vox
            e.hurt(30,{damageType:'火焰_0'})//综合喆喵所讲的知识(doge)
            e.player.directMessage('你收到了30点火焰伤害')
        }else if(ice_hurt.includes(vox)){
            e.hurt(20,{damageType:'冰冻_1'})
            e.player.directMessage('你收到了20点冰冻伤害')
        }else if(poison_hurt.includes(vox)){
            const m =Math.floor(Math.random()*50)
            e.hurt(m,{damageType:'毒素_2'})
            e.player.directMessage('你收到了'+m+'点毒素伤害')
        }
    })
})
world.onDie(async({ entity:e,damageType }) => {
    e.player.muted = true
    const damtyp=damageType.split('_')//分割,以便后面进行运算
    if(damtyp[1]=='0'){
        e.player.color.set(1,0,0)//红色
    }else if(damtyp[1]=='1'){
        e.player.color.set(0,0,1)//蓝色
    }else{
        e.player.color.set(0,1,0)//爱色
    }
    world.say(`${e.player.name}收到了${damtyp[0]}伤害后不幸趋势`)//广播消息
    for(i=3;i>0;i--){
        e.player.directMessage(i+'秒后复活')
        await sleep(1000)
    }
    e.player.color.set(1,1,1)
    e.player.forceRespawn()
})
world.onDie(({ entity, damageType }) => {
    if (damageType == "火焰") {
        entity.player.color.set(1,0,0); /*玩家实体颜色变红*/
    };
    if (damageType == "冰冻") {
        entity.player.color.set(0,0,1); /*玩家实体颜色变蓝*/
    };
});

2021-05-17T18:14:22 点赞:2

每日抄,快抄! 中回复

地址:https://box3.codemao.cn/e/5b0b1573562b5f11ae74

2021-05-18T18:59:11 点赞:0

每日抄,快抄! 中回复

emotion_编程猫_加油emotion_编程猫_加油emotion_编程猫_加油emotion_编程猫_加油emotion_编程猫_加油emotion_编程猫_加油emotion_编程猫_嗨起来emotion_编程猫_厉害了

2021-05-18T18:59:56 点赞:0

每日抄,快抄! 中回复

你加的代码可以写下来(一定要写!)

2021-05-18T19:12:57 点赞:0

招人建图啦 中回复

┻┳|・ω・)问我?

2021-05-18T19:19:52 点赞:0

关于box3的。需帮忙! 中回复

for (const e of world.querySelectorAll('*')) {
    e.collides = true //实体可以被碰撞
    e.fixed = true //实体固定位置
    e.onEntityContact(({ other }) => {
        if (other.isPlayer) { // 如果跟当前实体碰撞的是玩家实体
            e.destroy()  //当前实体消失
            other.player.invisible = true // 玩家皮肤隐藏
            other.mesh = e.mesh // 玩家的外形换成当前实体的外形
            other.meshScale.copy(e.meshScale) // 玩家外形的缩放比例设成跟当前实体一样
            other.player.scale = e.meshScale.scale(e.bounds.y / other.bounds.y) //喵家的隐形碰撞盒缩放到模型刚好贴地
        }
    })
}

 

https://www.bilibili.com/video/BV1g64y1S768

在某个坐标出生的4种写法:  

world.onPlayerJoin(({entity})=>{
    entity.player.spawnPoint.set(4, 11, 4)
    entity.player.forceRespawn()
})
world.onPlayerJoin(({entity})=>{
    entity.player.spawnPoint.set(4, 11, 4)
    entity.position.copy(entity.player.spawnPoint)
})
world.onPlayerJoin(({entity})=>{
    entity.player.spawnPoint = new Box3Vector3(4, 11, 4)
    entity.player.forceRespawn()
})
world.onPlayerJoin(({entity})=>{
    entity.player.spawnPoint = new Box3Vector3(4, 11, 4)
    entity.position.copy(entity.player.spawnPoint)
})

在某个模型的位置出生:

world.onPlayerJoin(({entity})=>{
    entity.player.spawnPoint = world.querySelector('#出生点').position
    entity.position.copy(entity.player.spawnPoint)
    entity.position.y += 10
})

2021-05-19T17:44:53 点赞:0

作者第一作品 中回复

https://shequ.codemao.cn/community/377761

2021-05-19T17:50:19 点赞:0

求代码,存档。 中回复

world.onPlayerJoin(({ entity }) => {     entity.player.enable3DCursor = true // 开启方块光标 })

 

world.onPress(({ raycast, button }) => {     if (button === Box3ButtonType.ACTION0) {         const pos = raycast.voxelIndex // 射线指到的方块位置         voxels.setVoxel(pos.x, pos.y, pos.z, '')     } }) world.onPlayerJoin(({ entity }) => {     entity.player.enable3DCursor = true // 开启方块光标 })

 

world.onPress(({ raycast, button }) => {     if (button === Box3ButtonType.ACTION0) {         const pos = raycast.voxelIndex.add(raycast.normal) // 射线指到的方块位置加上被选中的面的法线向量         voxels.setVoxel(pos.x, pos.y, pos.z, 'stone')     } }) const voxelList = ['stone', 'dirt', 'grass', 'lava01'] // 可选方块

 

world.onPlayerJoin(({ entity }) => {     entity.selected = 0 // 当前选定方块的序号     entity.player.enable3DCursor = true // 开启方块光标 })

 

world.onPress(({ entity, raycast, button }) => {     if (button === Box3ButtonType.ACTION0) {         const vox = voxelList[entity.selected]         const pos = raycast.voxelIndex.add(raycast.normal) // 射线指到的方块位置加上被选中的面的法线向量         voxels.setVoxel(pos.x, pos.y, pos.z, vox)     }     else if (button === Box3ButtonType.ACTION1) {         entity.selected = (entity.selected + 1) % voxelList.length         const vox = voxelList[entity.selected]         entity.player.directMessage(`当前选定"${vox}"`)     } }) world.onPlayerJoin(({ entity }) => {     entity.player.enable3DCursor = true // 开启方块光标     entity.selected = 'stone' // 玩家当前选定dirt方块 })

 

world.onPress(async ({ entity, raycast, button }) => {     if (button === Box3ButtonType.ACTION0) {         const pos = raycast.voxelIndex.add(raycast.normal) // 射线指到的方块位置加上被选中的面的法线向量         voxels.setVoxel(pos.x, pos.y, pos.z, entity.selected)     }     else if (button === Box3ButtonType.ACTION1) {         const selection = await entity.player.dialog({             type: Box3DialogType.SELECT,             content: '选择方块类型',             options: ['stone','dirt','grass','lava01','snow'],         })         if (selection) {             entity.selected = selection.value // 更新玩家当前选定方块         }     } })

2021-05-19T21:08:30 点赞:0

找师傅了!!!!! 中回复

我能干!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2021-05-19T21:11:51 点赞:0

找师傅了!!!!! 中回复

无聊

2021-05-19T21:12:22 点赞:0

找师傅了!!!!! 中回复

发地

发地址

 

2021-05-21T14:04:16 点赞:0

【岛3更新了】新增“蹦蹦床”方块,不用写代码也能跳得更高 中回复

https://box3.codemao.cn/e/55225d959f912aca328a

2021-05-21T18:07:30 点赞:0

代码岛招人了 中回复

我来!

2021-05-25T14:12:42 点赞:0