
Lv.1
签名:我正在做跑酷图形化编辑器 作品状态:已发布,测试版V1.3 作品是否可购买:是(True) 背景音乐:你好女生(伴奏) PS:作品里面有说明(没做完,空格+鼠标点击旋转)
在 【跳舞の代码】可以让玩家鬼畜了?一起来跳舞吧! 中回复
world.onPlayerJoin(async({entity})=>{
entity.player.dance = async function (time) {
var timeout = false;
(async()=>{
await sleep(time * 1000);
timeout = true;
})();
entity.enableDamage = true;
while(!timeout){
entity.hp = 501;
entity.position.x += Math.random() - 0.5;
entity.position.y += Math.random() * 2 - 1;
entity.position.z += Math.random() - 0.5;
entity.hurt(500);
entity.player.color.set(
Math.random(),
Math.random(),
Math.random()
);
await sleep(Math.random()*100);
};
entity.hp = entity.maxHp;
};
});
/*此代码请放于代码区或地图正在运行时放控制台*/
const all = world.querySelectorAll('player');
all[Math.floor(Math.random()*all.length)].player.dance(5);
/*此代码请放于代码区或地图正在运行时放控制台*/
world.querySelectorAll('player').forEach((e)=> e.player.dance(1));2021-10-06T21:25:44 点赞:0
在 【跳舞の代码】可以让玩家鬼畜了?一起来跳舞吧! 中回复
改良版(非玩家实体也可以了):
/**
* @function 让实体跳舞
* @param {Box3Entity} entity 跳舞的实体
* @param {number} time 跳舞的时间(单位:秒)
*/
async function dance(entity, time) {
var timeout = false;
(async () => {
await sleep(time * 1000);
timeout = true;
})();
entity.enableDamage = true;
while (!timeout) {
entity.hp = 101
entity.position.x += Math.random() - 0.5;
entity.position.y += Math.random() * 2 - 1;
entity.position.z += Math.random() - 0.5;
entity.hurt(100)
if (entity.isPlayer) {
entity.player.color.set(
Math.random(),
Math.random(),
Math.random()
);
}else{
entity.meshColor.set(
Math.random(),
Math.random(),
Math.random(),
1
);
}
await sleep(Math.random() * 100);
};
entity.hp = entity.maxHp;
};2021-10-06T21:36:38 点赞:0
在 【岛3神奇魔法创作节】魔法大闯关 中回复
这排版,逼我用图片写内容啊!附链接:游戏:https://box3.fun/p/magic-breakthrough用户主页:https://box3.fun/u/YuanQiQi
2021-10-07T14:45:55 点赞:1
在 【决战!赤碧城】修复BUG!V11测试版发布了!! 中回复
游戏链接喵ao.cn/p/decisive-battle 另外不准乱重启服务器,一经发现,封号处理!!
2021-11-06T19:19:41 点赞:0
在 【高级爬虫】F12输入以下代码,获得随机皮肤(仅1次,是分享活动的) 中回复
/*修正版,排版没了不影响运行*/function/**/post(url,data){return/**/new/**/Promise((r,r1)=>{ var/**/httpRequest=new/**/XMLHttpRequest(); httpRequest.open('POST',url,true); httpRequest.setRequestHeader("Content-type","application/json;charset=utf-8"); httpRequest.send(JSON.stringify(data)); httpRequest.onreadystatechange=function(){ if(httpRequest.readyState==4&&httpRequest.status==200){ var/**/json=httpRequest.responseText; let/**/data=JSON.parse(json); r(data); return/**/data } }; httpRequest.onerror=function(a){ r1(a) }; })}; post("https://"+"box3.codemao.cn/api/api/auth-server-rpc",{"type":"getAuthHash","data":"box3"}).then((r)=>{ var/**/httpRequest1=new/**/XMLHttpRequest(); httpRequest1.open('POST',"https://"+"backend.box3.fun/activity/share/giveSkin",true); httpRequest1.setRequestHeader("Accept","application/json,text/plain,*/*"); httpRequest1.setRequestHeader("Authorization",r.data.data); httpRequest1.setRequestHeader("Content-Type","application/json"); httpRequest1.send(JSON.stringify({"activityName":"christmas_newyear_share_activity","skinName":"randomSkin"})); httpRequest1.onreadystatechange=function(){ if(httpRequest1.readyState==4&&httpRequest1.status==200){ var/**/json=httpRequest1.responseText; let/**/data=JSON.parse(json); console.log(data); return/**/data; }; }; });
2021-12-26T16:52:14 点赞:0
在 【水】你们的体验号名字是什么?? 中回复
目前版本的正则表达式为:/[\u4e00-\u9fa5]+的[\u4e00-\u9fa5]+[a-zA-Z]+/
2022-01-02T18:56:24 点赞:1
在 【box3】自制地形编辑器对外开放啦! 中回复
控制台版:
const/**/o = 1.5;
function G(x, y) {
var/**/e = Math.E;
var/**/pi = Math.PI;
return 1 / (2 * pi * o * o) * Math.pow(e, -((x * x + y * y) / (2 * o * o)));
};
var/**/High = [];
(async/**/function () {
for (let/**/n = 0; n < 4; n++) {
High = [];
for (let/**/x = 0; x <= 256; x++) {
High.push([]);
for (let/**/z = 0; z <= 256; z++) {
y = 63;
for (let/**/y = 62; y >= 0; y--) {
if (voxels.getVoxelId(x, y, z) != 0) {
High[x].push(y);
break;
}
}
}
};
for (let/**/x = 1; x <= 255; x++) {
for (let/**/z = 1; z <= 255; z++) {
var/**/sub = 0;
for (let/**/i = 0; i < 3; i++) {
for (let/**/j = 0; j < 3; j++) {
sub += G(i - 1, j - 1);
}
};
var/**/hsub = 0;
for (let/**/i = 0; i < 3; i++) {
for (let/**/j = 0; j < 3; j++) {
hsub += G(i - 1, j - 1) / sub * High[x + i - 1][z + j - 1];
}
};
for (let/**/i = 0; i < Math.ceil(hsub); i++) { voxels.setVoxel(x, i, z, "dirt") };
voxels.setVoxel(x, Math.ceil(hsub), z, "grass");
for (let i = Math.ceil(hsub) + 1; i <= 63; i++) { voxels.setVoxel(x, i, z, "") };
await/**/sleep(1);
}
}
}
})()2022-01-20T19:33:50 点赞:0