猫史档案馆


AbnormalLOG

AbnormalLOG

Lv.1

我是屑

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

签名:小号__eq__, 大号__name__kP81.

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

机器人运行帖 中回复

/作品点赞

2021-02-03T10:47:04 点赞:0

谁能告诉我我这段代码为什么错了? 中回复

没有entity对象

最好放在

world.onPlayerJoin()里 就像这样:
world.onPlayerJoin(async({entity})=>{
//你的代码
})​

2021-02-04T09:31:38 点赞:1

【每日一个岛3建图小技巧】如何让模型发光? 中回复

sofa

2021-02-04T11:04:54 点赞:0

求助载人列车代码 中回复

载人列车代码:

var velocity=0
var traindoor=false
world.onTick(() => {
    world.querySelectorAll(".显示").forEach((x)=>{
        x.enableInteract=true
        x.interactHint="velocity:"喵elocity+",traindoor:"+traindoor
    })
    world.querySelectorAll(".列车零件").forEach((e) =>{
        e.velocity.z = velocity
        if (e.position.z<-1900) {
            velocity=0
            world.say("没路啦!")
        }
    })
})


world.onClick(({entity,clicker,button})=>{
    if (button==Box3ButtonType.ACTION0) {
        if (entity.hasTag("刹车")) {
            velocity=0
        } else if (entity.hasTag("加速")) {
            velocity+=-0.3
        } else if (entity.hasTag("减速")) {
            velocity+=0.3
        } else if (entity.hasTag("车门1") || entity.hasTag("车门2")) {
            if (!traindoor) {
                world.querySelector(".车门1").position.z+=1
                world.querySelector(".车门2").position.z-=1
                traindoor=!traindoor
            } else if (traindoor) {
                world.querySelector(".车门1").position.z-=1
                world.querySelector(".车门2").position.z+=1
                traindoor=!traindoor
            }
        }
    }
})

2021-02-07T10:15:08 点赞:0

如果你把年龄倒过来给你1亿你同意吗? 中回复

同意,我11岁

2021-02-07T18:55:33 点赞:0

【征集恐怖地图意见】你们喜欢什么风格的恐怖地图呀 中回复

444

2021-02-08T16:47:04 点赞:0

【全民接龙大创作】提名名单揭晓!今晚老时间老地点,7点B站直播! 中回复

center_image

吉吉喵你真的在约会吗

2021-02-08T18:16:53 点赞:0

【全民接龙大创作】提名名单揭晓!今晚老时间老地点,7点B站直播! 中回复

是要有优质才有年兽皮肤吗

2021-02-08T20:08:08 点赞:0

怎么回事?大佬帮帮忙 中回复

#改为:
print("您的BMI指数为"+str(bim))
print("体重过重@_@")

2021-02-09T14:04:36 点赞:1

[~\(≧▽≦)/~啦啦啦我有隐形字] 中回复

蹦 

2021-02-09T19:43:50 点赞:0

[~\(≧▽≦)/~啦啦啦我有隐形字] 中回复

<span style="color: #fcfcfc;">蹦</span>

2021-02-09T19:44:10 点赞:0

[~\(≧▽≦)/~啦啦啦我有隐形字] 中回复

hehe

2021-02-09T19:44:34 点赞:0

全民接龙大创作“完结撒花”,获奖名单公布! 中回复

吉吉喵我的皮肤呢

2021-02-09T19:47:27 点赞:0

全民接龙大创作“完结撒花”,获奖名单公布! 中回复

年兽皮肤发下来了!

2021-02-09T21:24:18 点赞:1

全民接龙大创作“完结撒花”,获奖名单公布! 中回复

center_image

2021-02-10T10:48:26 点赞:0

一键生成树林!!!(修改版) 中回复

改一下:

function cylinder(cx, cy, cz, vox, radius, height) {
    xend = cx + radius;
    yend = cy + height;
    zend = cz + radius;
    for (let x = cx - radius; x <= xend; x++) {
        for (let z = cz - radius; z <= zend; z++) {
            dx = x - cx;
            dz = z - cz;
            if (Math.round(Math.sqrt(dx * dx + dz * dz)) <= radius) {
                for (let y = cy; y < yend; y++) {
                    voxels.setVoxel(x, y, z, vox);
                };
            };
        };
    };

};

for (let i = 0; i < 340; i++) { /* 300个随机圆柱体构成场景*/
    x = Math.random() * 325; /* x坐标*/
    z = Math.random() * 325; /* z坐标*/
    r = 2 + Math.random(); * 5 /*半径 2~7*/
    h = Math.random() * 4; /* 高 0~4*/
    cylinder(x, 9, z, 'dirt', r, h);
};

for (let y = 9; y < 13; y++) {//扫描9~12层的格子
    for (let x = 0; x < 327; x++) {
        for (let z = 0; z < 327; z++) {
            if (voxels.getVoxel(x, y, z) != 0 && voxels.getVoxel(x, y + 1, z) == 0) {/* 如果当前格子不为空而它上面那格是空的, 则表示它是此地形的表面 */
                voxels.setVoxel(x, y, z, 'grass');/* 土块替换成喵地*/
            };
        };
    };
};
async function 喵(x, y, z, r = 0) {
    r = Math.floor(Math.random() * 5+2);
    for (let q = x-r;q < x+r;q++){
        for (let w = y;w<y+r;w++){
            for (let e = z-r;e<z+r;e++){
                voxels.setVoxel(q,w,e,'green_leaf');
            };
        };
    };
};
for (let w = 0; w < 601; w++) {
    var 喵 = Math.floor(Math.random() * 280);
    var wz = Math.floor(Math.random() * 280);
    var wc = Math.floor(Math.random() * 10);
    while (!wc % 2 === 1) {
        var wc = Math.floor(Math.random() * 10);
    };
    var wth = Math.floor(Math.random() * 10);
    var wh = Math.floor(Math.random() * 12) + 7;
    for (let w1 = 7; w1 < 7 + wh; w1++) {
        voxels.setVoxelId(喵, w1, wz, voxels.id('wood'));
    };
    喵(喵, 7 + wh, wz);
    world.say('地形生成中...请耐心等待...(' + w + '/600)');
};



2021-02-12T10:18:52 点赞:0

Box3.0在线等,急 中回复

改成这样:

const DefaultScale = [0.0625,0.0625,0.0625]

function spawn (x,y,z,meshName){
    var entity = world.createEntity({
        mesh:meshName,
        collides:true,
        fixed:false,
        gravity:true,
        friction:0.5,
        meshScale:DefaultScale,
        position:[x,y,z],
    });

    entity.onVoxelContact(({x,y,z,voxel})=>{
        entity.velocity.y = 0.5 + Math.random()*0.5
        entity.velocity.x = (Math.random - 0.5)*0.5
        entity.velocity.z = (Math.random - 0.5)*0.5

        if(vosel == voxels.id('stone')){
            
        }
        else{
            voxels.setVoxel(x,y,z,'')
        }
        
    })

    return entity
}

for(var i=0;i<250;i++){
    spawn (63,11+i,63,'mesh/公鸡.vb')
}

2021-02-12T11:17:28 点赞:0

【悬赏】最长的 屏 蔽 词 组 中回复

喵主义的幽灵

2021-02-13T12:26:49 点赞:0

【岛3找人:水上跑酷】 中回复

代码

2021-02-14T13:57:54 点赞:0

你们做的传说之下决心是怎么不出战斗框的? 中回复

center_image

2021-02-15T13:59:28 点赞:0

【获奖公布】六周年作品征集&盖楼活动&家乡话,奖项公布啦~ 中回复

沙发

2021-03-11T21:15:00 点赞:0

【岛3活动】大神在线写代码NO.2,你想实现的我都会! 中回复

我想要实现激战! 喵斗技场-v2.7中AIboss的效果,需要发射子弹的效果

2021-03-19T17:21:03 点赞:1

教教我谢谢! 中回复

把nqc.id改成npc.id

2021-03-20T15:34:05 点赞:0

【岛3活动】搬砖喵看家代码公布:粒子大乱斗! 中回复

喵是什么?

2021-03-24T20:37:38 点赞:0

【岛3创作节】爆“肝”48小时后,你们做出了怎样的作品? 中回复

拉一票https://shequ.codemao.cn/community/370116

链接:https://box3.codemao.cn/p/caidao-zhan

2021-03-28T17:57:59 点赞:0

【岛3创作节】爆“肝”48小时后,你们做出了怎样的作品? 中回复

2021-03-29T20:37:34 点赞:0

【公告】申诉流程指南 中回复

你的帖子【阿考のNCT哔哔机】震惊!学编程居然会被人追着跑?下的回复“学编程前:这游戏真好玩 学编程后: import sys,os,glob from PySide2.QtWidgets import* from PySide2.QtCore import* from PySide2.QtGui import* class Ui_Window: def setupUi(self, Window): if not Window.objectName(): Window.setObjectName(u"Window") Window.resize(837, 623) self.centralwidget = QWidget(Window) self.centralwidget.setObjectName(u"centralwidget") self.verticalLayout = QVBoxLayout(self.centralwidget) self.verticalLayout.setObjectName(u"verticalLayout") self.pix = QLabel(self.centralwidget) self.pix.setObjectName(u"pix") font = QFont() font.setFamily(u"\u5fae\u8f6f\u96c5\u9ed1") self.pix.setFont(font) self.pix.setAlignment(Qt.AlignCenter) self.verticalLayout.addWidget(self.pix) self.sbutton = QPushButton(self.centralwidget) self.sbutton.setObjectName(u"sbutton") self.verticalLayout.addWidget(self.sbutton) self.xbutton = QPushButton(self.centralwidget) self.xbutton.setObjectName(u"xbutton") self.verticalLayout.addWidget(self.xbutton) self.openfile = QPushButton(self.centralwidget) self.openfile.setObjectName(u"openfile") self.verticalLayout.addWidget(self.openfile) Window.setCentralWidget(self.centralwidget) self.menubar = QMenuBar(Window) self.menubar.setObjectName(u"menubar") self.menubar.setGeometry(QRect(0, 0, 837, 22)) Window.setMenuBar(self.menubar) self.statusbar = QStatusBar(Window) self.statusbar.setObjectName(u"statusbar") Window.setStatusBar(self.statusbar) self.retranslateUi(Window) QMetaObject.connectSlotsByName(Window) def retranslateUi(self, Window): Window.setWindowTitle(QCoreApplication.translate("Window", u"\u56fe\u7247\u9884\u89c8", None)) self.pix.setText(QCoreApplication.translate("Window", u"\u56fe\u7247\u9884\u89c8", None)) self.sbutton.setText(QCoreApplication.translate("Window", u"\u4e0a\u4e00\u5f20", None)) self.xbutton.setText(QCoreApplication.translate("Window", u"\u4e0b\u4e00\u5f20", None)) self.openfile.setText(QCoreApplication.translate("Window", "打开图片", None)) class Tray(QSystemTrayIcon): def __init__(self): super().__init__() self.setup self.show() @property def setup(self): self.setIcon(QIcon("sit.png")) self.window=Window() self.menu=QMenu() actionexit = QAction('退出', self, triggered=self.quit) actionnext = QAction('下一张', self, triggered=self.window.next) actionlast = QAction('上一张', self, triggered=self.window.last) actionopenfile = QAction('打开文件', self, triggered=self.window.open) self.menu.addAction(actionexit) self.menu.addAction(actionnext) self.menu.addAction(actionlast) self.menu.addAction(actionopenfile) self.setContextMenu(self.menu) def quit(self): self.hide() self.window.quit() class Window(QMainWindow,Ui_Window): def __init__(self): super().__init__() self.setupUi(self) self.setup self.show() @property def setup(self): self.setWindowIcon(QIcon("sit.png")) self.openfile.clicked.connect(self.open) self.sbutton.clicked.connect(self.last) self.xbutton.clicked.connect(self.next) self.pix.setScaledContents(True) self.pic_list=[] self.index=0 self.icon_index=0 self.icons=["cat/0.png","cat/1.png","cat/2.png","cat/3.png","cat/4.png"] self.timer=QTimer() self.change_icon() self.pix.setPixmap(QPixmap("sit.png")) def quit(self): self.hide() sys.exit(0) def next(self): if not self.pic_list == []: self.index+=1 self.pix.setPixmap( QPixmap( self.pic_list[self.index%len(self.pic_list)] ) ) def last(self): if not self.pic_list == []: self.index-=1 self.pix.setPixmap( QPixmap( self.pic_list[self.index%len(self.pic_list)] ) ) def filterfile(self,filepath): for i in glob.glob(os.path.dirname(os.path.abspath(filepath))+"/*"): #找到文件所在的文件夹 if os.path.splitext(i)[-1] in [".jpg",".png",".bmp",".jpeg"]: #查看后缀 if i not in self.pic_list: #如果在文件夹中有就不用再添加(返回)了 yield i #返回一个迭代器 def open(self): file_path=QFileDialog.getOpenFileName(caption="选择乐谱",filter="(*.jpg *.png *.bmp *.jpeg)")[0] if file_path: self.pix.setPixmap(QPixmap(file_path)) for i in self.filterfile(file_path): self.pic_list.append(i) print(f"addfile:{i}") print(f"file list:{self.pic_list}") self.index += 1 def change_icon(self): self.setWindowIcon(QIcon(self.icons[self.icon_index%len(self.icons)])) self.icon_index += 1 self.timer.singleShot(100,self.change_icon) if __name__ == "__main__": app=QApplication(sys.argv) window_tray=Tray() sys.exit(app.exec_()) &nbsp;”被举报“垃圾广告”,经管喵核实被判定为违规评论,已被删除,如有问题可前往反馈。

 

垃圾广告??!

2021-03-31T17:28:48 点赞:1

【Kitten积木实验室入门教程】第二期在线用户数积木的使用 中回复

喵沙发

2021-04-10T13:29:30 点赞:0

【UT】怎么制作屏幕旋转 中回复

0

 

 

 

 

 

 

 

2021-04-11T08:38:49 点赞:0

【box3】求助:谁知道岛三的模型文件(.vd)的数据的规律。? 中回复

数据格式为JSON,元素好像有些是16进制的颜色编码

2021-04-11T18:22:44 点赞:0