
Lv.1
主要是在代码岛欧~https://box3.codemao.cn/u/zxz1845
签名:神奇代码岛地图:永宁街探案
在 【喜报】最新研究成果【射线检测子弹代码】首次成功检测 中回复
https://box3.codemao.cn/e/b喵9a7cf4fc80d04e9c3 芜能帮我检查一下代码,屑屑
2022-09-11T12:15:31 点赞:0
在 如何增加图片像素,目前是96 96 96,能不能变成2048 2048 2048 中回复
你先把大小更改为2048,2048,1,然后把图片导入就行。不过会很卡
2022-10-19T21:45:40 点赞:0
在 【求助】怎么在神岛做出按钮选项效果 中回复
const npc2 = world.querySelector('#彩蛋-1');
npc2.enableInteract = true; // 允许进行互动
npc2.interactRadius = 3; // 实体的互动范围
npc2.interactHint = npc2.id; // 互动提示框显示实体的名称
npc2.interactColor = new Box3RGBColor(1,1,1); // 互动提示的文字颜色
// 玩家与实体进行交互时触发
//在这里说一下,如果要给第二个npc使用,那么这个代码里的 npc2 就要更换,换成啥随便
npc2.onInteract(async({entity}) => {
const result = await entity.player.dialog({
type: Box3DialogType.SELECT,
title: "彩蛋-1",//放一个名叫‘彩蛋-1’的npc进去
titleTextColor: new Box3RGBAColor(0, 0, 0, 1),
titleBackgroundColor: new Box3RGBAColor(0.968, 0.702, 0.392, 1),
content: `恭喜你找到了彩蛋-1,可以变色,你想要什么颜色?`,
options: ['红色', '蓝色','黄色','绿色'], // 将提供玩家选择的选项放入数组里。
contentTextColor: new Box3RGBAColor(0, 0, 0, 1),
contentBackgroundColor: new Box3RGBAColor(1, 1, 1, 1),
lookEye: entity.position.add(entity.player.facingDirection.scale(5)),
lookTarget: entity,
});
// 如果玩家点击了屏幕其他区域,取消了对话框。
if(!result || result === null){
return;
}
// 判断玩家选了什么选项。
switch (result.index) {
case 0:
//如果选择了第一项
entity.player.color.set(1, 0, 0)//变红
break;
case 1:
// 如果选择了第二项
entity.player.color.set(0, 0, 1)//变蓝
break;
case 2:
// 如果选择了第三项
entity.player.color.set(1, 1, 0)//变黄
break;
case 3:
// 如果选择了第四项
entity.player.color.set(0, 1, 0)//变绿
break;
default:
// 注意,使用 switch 分支的时候,不要漏了后面的 break;
}
});2022-10-25T08:21:59 点赞:0
在 【神岛创作节】万圣节那晚,我进入了32*32的异世界…… 中回复
把这个代码加入你们的地图,真的很棒
async function init() {
while (true) {//无限循环
await sleep(Math.random()*1000)
world.sunPhase = 0.5
await sleep(500)//等待500毫秒
world.sunPhase = 0.75
await sleep(10000)//等待10000毫秒
}
}
init()2022-10-27T16:56:00 点赞:0