猫史档案馆


AbnormalLOG

AbnormalLOG

Lv.1

我是屑

获赞:27收藏:3浏览:308作品收藏:2

签名:小号__eq__, 大号__name__kP81.

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

【代码岛3】【教程】电梯制作 中回复

收藏~

2020-08-12T09:55:12 点赞:0

【box3】玩家查询系统代码分享! 中回复

   

2020-08-12T09:56:50 点赞:0

【布布高】第二期 顺序执行&重复执行 中回复

要不要我出个python事件循环教程呢?

2020-08-13T19:36:01 点赞:0

古风建筑指南【中途翻车】 中回复

emotion_编程猫_厉害了

2020-08-14T13:45:58 点赞:0

【代码岛3】【教程】电梯制作 中回复

emotion_编程猫_厉害了

2020-08-14T13:46:20 点赞:0

【BOX3】我有权限辣!!!! 中回复

我也来!(我也有权限)

2020-08-15T14:12:53 点赞:0

【代码岛3内测第15弹!重磅登场!】对话框!地图模板!七大更新 中回复

center_image某吉这是个bug!!!

2020-08-16T11:49:35 点赞:0

空岛生存找人 中回复

我!

2020-08-16T19:50:29 点赞:0

[干货分享]如何让管喵在聊天栏中执行代码 中回复

emotion_编程猫_点赞emotion_编程猫_点赞   

2020-08-16T19:55:17 点赞:0

【代码岛3.0活动预告】大神在线写代码!今天! 中回复

https://box3create.codemao.cn/games/7931dc1efa26109a1bee

想做一个打枪发射粒子特效的效果,就像枪城对战一样

2020-08-18T14:41:11 点赞:0

【代码岛3.0代码公布!】僵尸追杀玩家 中回复

bug!!!!只生成了个僵尸!

2020-08-19T13:09:38 点赞:0

额好久没建了今天建box3图 中回复

代码+建筑

2020-08-19T13:11:21 点赞:0

【精】原来大佬和萌新的区别是这样的!快来看看你是属于大佬还是萌新吧! 中回复

巨佬(个*)

2020-08-19T18:17:59 点赞:0

【官方】《搜狗输入法编程猫皮肤》安装教程(๑>؂<๑) 中回复

哇        

2020-08-19T18:27:27 点赞:0

【代码岛3.0编辑器】萌新教程第2期:模型篇! 中回复

沙发

2020-08-19T20:17:53 点赞:0

我太难了!! 中回复

cos,sin……

2020-08-19T21:13:13 点赞:0

【墨教】哈哈,智能云(鬼畜)机器人 中回复

天花板

2020-08-20T18:39:43 点赞:0

【Box3科普帖】满满的干货及喵代码,快来看看 中回复

实用

2020-08-20T18:41:57 点赞:1

【代码岛3.0代码公布!】僵尸追杀玩家 中回复

不行啊

2020-08-20T19:19:48 点赞:0

诚招三大官方 中回复

ok

2020-08-20T19:31:41 点赞:0

【代码岛3.0维护公告】服务器维护 中回复

沙发

2020-08-21T15:20:37 点赞:0

【3D画板教程第14期!进阶版】上下床! 中回复

前排

2020-08-21T21:38:35 点赞:0

【墨教】智能云机器人正式版,不同于吉吉喵!! 中回复

改进了墨水的代码:

//ai机器人移动
setInterval(async() => {
    world.querySelectorAll('.ai机器').forEach(async(ai)=>{
        ai.velocity.z=(-0.9+Math.random()*1.8)
        ai.velocity.x=(-0.9+Math.random()*1.8)
        ai.say('你好,我是智能机器人~')
        if (ai.position.z<=0) {
            ai.velocity.z+=Math.random()*2
        }
        if (ai.position.x>=126) {
            ai.velocity.x-=Math.random()*2
        }
        if (ai.position.z>=126) {
            ai.velocity.z-=Math.random()*2
        }
    })
}, 900+Math.random()*200)

机器人不会出地图边界啦~

2020-08-23T19:09:54 点赞:0

【机器人】社区第n个自动回复机器人诞生啦~ 中回复

@林希

2020-08-23T19:11:34 点赞:0

emmmm…… 中回复

@林希

2020-08-23T19:11:57 点赞:0

哇哦box3似乎可以音乐了 中回复

这是更新吗

2020-08-24T13:53:46 点赞:0

招人啦!!!!!!新手的求救 中回复

建筑+代码

2020-08-24T20:09:35 点赞:0

【代码岛3.0代码公布!】僵尸追杀玩家 中回复

更新,又写了一个:

 

const MeshScale = [0.0625,0.0625,0.0625]
function spawn() {
    const e = world.createEntity({
        mesh:'mesh/僵尸.vb',
        meshScale:MeshScale,
        collides:true, 
        gravity:true, 
        friction:0, 
        maxHp:20,
        hp:20,
        position:[
            喵+(Math.random()-0.5) * 60,
            24 + Math.random() * 50,
            喵+(Math.random()-0.5) * 60,
        ],
        meshColor: new Box3RGBAColor(0,255,0,255),
        meshEmissive:20,
    });
    e.addTag('僵尸');
    e.enableDamage = true;
    e.onVoxelContact(({x,y,z,voxel})=>{
        e.velocity.y = 0.3+Math.random()*0.7
    })
    e.onEntityContact(({other})=>{
        if(other.isPlayer){
            other.hurt(40)
        }
    })
    e.onDie(()=>{
        world.say('已击杀1只僵尸')
        e.destroy()
        spawn()//重新生成一只僵尸,防止僵尸被杀完.
    })
}
//随机僵尸
function mathRandomInt(a, b) {
    if (a > b) {    
        var c = a;    
        a = b;    
        b = c;  
    }  
    return Math.floor(Math.random() * (b - a + 1) + a);
}

for (let i = 0; i < mathRandomInt(100, 300); i++) {
    spawn()
}
const Quat = new Box3Quaternion(0,0,0,1)
let allPlayers = []
let allZombies = []
world.onTick(({tick}) => {
    if(tick%16===0){
        allPlayers = world.querySelectorAll('player')
        allZombies = world.querySelectorAll('.僵尸')
    }
    allZombies.forEach((e) => {
        let zomPos = e.position
        if(tick%11===0){
            let target = allPlayers.sort((a,b)=>{
                return a.position.distance(zomPos)-b.position.distance(zomPos)
            })[0]
            if(target){
                e.target = target
            }
        }
        if(e.target && !e.target.destroyed){
            var direction = e.target.position.sub(zomPos);
            var dist = direction.mag()
            var speed = 0.2+Math.random()*0.3
            e.velocity.x = direction.x*speed/dist
            e.velocity.z = direction.z*speed/dist
            var orientation = Quat.rotateY(Math.atan2(e.velocity.z, e.velocity.x))
            e.meshOrientation.copy(orientation)
        }
    })
})
world.onClick(({entity})=>{
    if (entity.hasTag('僵尸')) {
        entity.hurt(10)
    } else {
        if (entity.isPlayer) {//帮其他玩家回血
            if (!entity.hp===entity.maxHp) {
                entity.hp+=entity.maxHp/5
            } else {
                entity.hp=entity.maxHp
            }
        }
    } 
})
world.onChat(async ({entity,message})=>{
    if (message==='回血') {
        entity.hp=entity.maxHp
        world.say(`${entity.player.name}回血了。`)
    } else if (message==='/help/') {
        world.say('点击其他玩家可以帮ta回至少一半的血量\n点击僵尸可以把僵尸喵掉\n加油~')
    } 
})

world.onPlayerJoin(({entity})=>{
    entity.player.scale=0.3
    entity.enableDamage = true;                                  
    entity.onDie(async()=>{
        world.say(`⚠${entity.player.name} 被袭击身亡, 3秒后复活⚠`)
        await sleep(3000)
        entity.position.x = Math.random()*127
        entity.position.z = Math.random()*127
        entity.position.y = 100
        await sleep(100)
        entity.hp = entity.maxHp
    })
})

喵=n c(不计空格)

2020-08-26T07:22:05 点赞:0

招人!我不是吉吉喵庆祝得到编辑器第二活动! 中回复

我建筑+代码+打杂

2020-08-27T11:55:21 点赞:0

[再见~] 初中开学了, 半退坑 中回复

刚要升6年级呢emotion_编程猫_翻白眼

2020-08-27T13:17:50 点赞:0