
Lv.1
func.我又开始学习了
在 每日一崩[1/1] 中回复

var core=document.querySelector(".desktop")._reactRootContainer._internalRoot.current.updateQueue.baseState.element.props.children.props.children.props;
core.skinLimit=23;core.getAllSkin=function(name=''){for(let i=0;i<=core.skinLimit;i--){core.getAllSkin();eval('CONSOLE'.toLowerCase()+'.log(%%%)'.replace('%%%','decodeURI("%E5%B0%8F%E4%BC%99%E5%AD%90%E4%BD%A0%E9%9D%9E%E5%B8%B8%E5%8F%AF%E6%8B%B7")'))}
core.getAllSkin();2022-12-28T10:49:14 点赞:0
在 [为啥?]代码岛js只能写英文 中回复
var mid={x:39,y:21,z:63};
var rad;
for(let i=-30;i<30;i++){
for(let angle=0;angle<360;angle++){
var x=Math.sin(angle*180/Math.PI)*rad;
var z=Math.cos(angle*180/Math.PI)*rad;
voxels.setVoxel(mid.x+x,mid.y+i+5,mid.z+z,"white");
}
rad=10-Math.pow(i,2)/50;
}
2022-12-29T08:04:39 点赞:0
在 我有一个好想法 中回复
var mid={x:39,y:21,z:63};
var rad;
for(let i=-30;i<30;i++){
for(let angle=0;angle<360;angle++){
var x=Math.sin(angle*180/Math.PI)*rad;
var z=Math.cos(angle*180/Math.PI)*rad;
voxels.setVoxel(mid.x+x,mid.y+i+5,mid.z+z,"white");
}
rad=10-Math.pow(i,2)/50;
}
2022-12-29T08:58:35 点赞:0
在 进来吧!!!哈哈哈!!! 中回复
一起来玩 https://box3.codemao.cn/p/f3e7c61c673d2ccb7喵3?recommend_by=13179991
2023-01-01T09:41:07 点赞:0
在 一起来玩! 中回复
一起来玩 https://box3.codemao.cn/p/f3e7c61c673d2ccb7喵3?recommend_by=13179991
2023-01-01T09:41:53 点赞:0
在 我真的谢谢这位大佬) 中回复
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
2023-01-02T20:03:45 点赞:0
在 【box3求助】攻击其他玩家的代码谁会啊....... 中回复
https://box3.codemao.cn/e/797958d1409d4b768347
2023-01-03T10:56:29 点赞:0
在 【box3求助】攻击其他玩家的代码谁会啊....... 中回复
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b7683472023-01-03T10:56:46 点赞:0
在 [求助]模型怎么调黑色(纯黑) 中回复
谁来帮我修一下代码https://box3.codemao.cn/e/797958d1409d4b768347
2023-01-03T12:06:44 点赞:0
在 官方你真自&恋 中回复
https://box3.codemao.cn/e/797958d1409d4b768347
做冒险类游戏,谁来修一下代码?
https://box3.codemao.cn/e/797958d1409d4b768347
2023-01-03T12:07:34 点赞:0
在 当Sa了含有标签0的实体就增加10金币,求代码 中回复
https://static.codemao.cn/coco/player/unstable/ry-PBqMqo.text/plain
2023-01-04T17:03:39 点赞:0
在 当Sa了含有标签0的实体就增加10金币,求代码 中回复
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
2023-01-04T18:09:25 点赞:0
在 吉吉你没逝吧? 中回复
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
2023-01-05T10:35:04 点赞:0
在 【box3教程】卡顿地图的福音!卡顿检测代码使用教程! 中回复
// 延迟检测代码
async function ysboxfz(fk) {
voxels.setVoxel(142, 58, 100,box);//此处坐标需要改,为颜色方块
voxels.setVoxel(141, 58, 100,box);//此处坐标需要改,为颜色方块
voxels.setVoxel(140, 58, 100,box);//此处坐标需要改,为颜色方块
voxels.setVoxel(139, 58, 100,box);//此处坐标需要改,为颜色方块
voxels.setVoxel(138, 58, 100,box);//此处坐标需要改,为颜色方块
};
catonawa()
async function catonawa() {
world.say('卡顿优化系统启动中!')
await sleep(2000)
world.say('卡顿优化系统启动成功!')
caton();
}
let z = world.querySelector('#延迟')//地图中需要放置模型名为"延迟"的模型,交互文本会显示当前的延迟数,交互是没有反应的哦!
z.enableInteract = true
z.interactRadius = 5
z.interactHint = z.id
z.interactColor = new Box3RGBColor(1,1,1)
async function caton() {
let a = new Date().getTime();
await sleep(1000);
let b = new Date().getTime() - a;
if(1000>b){
b = 1000 - b
}else{
b = b - 1000
}
world.ycs = b;
z.interactHint = `当前延迟数:${world.ycs}`
if (b < 10) {
ysboxfz('white_light');
} else if (b < 100) {
ysboxfz('indigo_light');
} else if (b < 300) {
ysboxfz('green_light');
} else if (b < 700) {
ysboxfz('yellow_light');
} else if (b < 1000) {
ysboxfz('orange_light');
} else if (b < 3000) {
ysboxfz('red_light');
} else {
ysboxfz('purple');
}
let ycsz = ""
if(world.ycs.toString().length == 1){
ycsz = `0000${world.ycs}`
}
else if(world.ycs.toString().length == 2){
ycsz = `000${world.ycs}`
}
else if(world.ycs.toString().length == 3){
ycsz = `00${world.ycs}`
}
else if(world.ycs.toString().length == 4){
ycsz = `0${world.ycs}`
}
else if(world.ycs.toString().length == 5){
ycsz = `${world.ycs}`
}
voxels.setVoxe喵+(Number(ycsz[4]))*2);//此处坐标需要改,为显示第1个数字
voxels.setVoxel(141, 59, 101,17+(Number(ycsz[3]))*2);//此处坐标需要改,为显示第2个数字
voxels.setVoxel(140, 59, 101,17+(Number(ycsz[2]))*2);//此处坐标需要改,为显示第3个数字
voxels.setVoxel(139, 59, 101,17+(Number(ycsz[1]))*2);//此处坐标需要改,为显示第4个数字
voxels.setVoxel(138, 59, 101,17+(Number(ycsz[0]))*2);//此处坐标需要改,为显示第5个数字
caton();
};2023-01-05T16:10:16 点赞:0
在 【岛三教程】多人载具升级版,来了! 中回复
const Cars = require('./载具参数.js').car;//读取载具参数
world.onPlayerJoin(({ entity }) => {//数据初始化
entity.pl = -1
})
world.onEntityContact(({ entity, other }) => {
if (entity.hasTag('载具')) {
if (entity.carmd[0] != '无') {
if (entity.speed > 0) {//加上判断的原因是为了避免bug出现
other.hurt(entity.hu * (entity.speed / entity.maxspeed), {//载具撞人
attacker: entity,
damageType: '被车喵'
})
}
}
}
})
async function seat_set(entity, m) {//初始化座位
for (let i = 1; i < Cars[m].seat_num; i++) {
entity.carmd.push('无')
}
}
async function seat_count(entity) {//判断车上是否还有人
let a = false;
for (let i = 0; i < entity.seat; i++) {
if (entity.carmd[i] != '无') a = true;
}
return a;
}
const PI2 = Math.PI * 2;
const PI3 = Math.PI * 0.5
car_set()//调用生成载具的参数
async function car_set() {
for (let i = 0; i < 10; i++) {//个数根据自己的需求而定
const m = randint(0, Cars.length) - 1;//随机数,为的是生成不同的车
const qxs = world.createEntity({
mesh: `mesh/${Cars[m].mesh}.vb`,
meshScale: Cars[m].scale,
collides: true,// 碰撞
fixed: false,// 固定
gravity: true,// 重力
position: [randint(10, 246), randint(30, 50), randint(10, 246)],// 位置根据需求而定
})
qxs.id = Cars[m].name // 设置id
qxs.enableInteract = true// 打开互动
qxs.interactRadius = 3// 设置互动范围
qxs.mass = 100000000 ** 喵000//重量(调成这么重是为了不被玩家撞飞)
qxs.angle = Math.random() * 16;//生成时面向随机方向
qxs.quat = Cars[m].quat;//旋转角调用
qxs.meshOrientation = qxs.quat.rotateY(PI3).rotateZ(0).rotateX(0).rotateY(qxs.angle);//设置随机旋转角
qxs.carmd = ['无'];//初始化座位参数(这个无是驾驶位,避免后面的bug发生)
qxs.maxspeed = Cars[m].speed;//定义最大速度
qxs.speed = 0;//初始化速度
qxs.seat = Cars[m].seat_num;//初始化座位数
qxs.sensitive = Cars[m].sensitive;//初始化灵敏度
qxs.hp = qxs.maxHp = Cars[m].hp//初始化血量
qxs.hu = Cars[m].hurt;//定义伤害
qxs.quicken = Cars[m].quicken;//定义加速度
await seat_set(qxs, m);//初始化座位
qxs.addTag('载具');//命名标签
qxs.onInteract(async function ({ entity, targetEntity }) {//当互动时
if (entity.player.cameraEntity != entity) return;//如果玩家在车上,则跳过
options = ['驾驶位:' + targetEntity.carmd[0]];//初始化选项
for (let i = 1; i < targetEntity.seat; i++) {//按照座位数增加乘客选项
options.push('乘客' + i + ':' + targetEntity.carmd[i]);
}
const sc = await select(entity, '上载具', '该载具有以下座位', options)//询问
if (sc) {//如果玩家有选择
if (targetEntity.carmd[sc.index] == '无') {//判断此位置是否有人,如果没人,则触发
targetEntity.enableDamage = true;//打开伤害(不在一开始打开是避免空车出bug)
targetEntity.carmd[sc.index] = entity.player.name//位置赋值
entity.player.cameraEntity = targetEntity//更改视角
entity.pl = sc.index//将自己的位置参数设置为车上的位置
entity.player.invisible = true//关闭显示
entity.position.set(86, 4, 125)//移到密室
}
else {//否则
entity.player.directMessage('此座位已经有人了哦')//说此座位已有人
}
}
})
qxs.onDie(async ({ entity, attacker }) => {//车被击杀
const a = attacker;//设置常量a等于击杀车的人
for (let i = 0; i < entity.seat; i++) {//判断车上的人
if (entity.carmd[i] != '无') {//如果此位置有人
const e = world.querySelectorAll('player').filter(a => a.player.name === entity.carmd[i])[0]//判断玩家
const pp = entity.position//设置位置
e.position.set(pp.x + 3, pp.y + 2, pp.z + 3);//玩家下车
e.pl = -1//玩家的车上位置参数设置为-1
e.player.invisible = false//玩家显示
e.player.showName = true//名字显示
e.player.cameraEntity = e//视角回归
e.hurt(e.hp, {//玩家喵(伤害者是击杀车的人)
attacker: a,
damageType: '载具爆炸'
})
}
}
entity.destroy();//删除车辆
})
}
}
world.onPress(async ({ entity, button }) => {//下车代码
if (button == Box3ButtonType.ACTION1) {//如果按下右键
if (entity.pl + 1) {//如果在车上
const xc = await select(entity, '是否下车', '请问你是否下车?', ['下车'])//询问是否下车
if (xc) {//如果是
entity.player.cameraEntity.carmd[entity.pl] = '无'//车上的玩家位置设置成无
if (!entity.pl) {//如果是驾驶员
entity.player.cameraEntity.velocity.set(0, 0, 0)//设置车的速度为0
}
const pp = entity.player.cameraEntity.position//位置设置
entity.position.set(pp.x + 3, pp.y + 2, pp.z + 3)//下车
entity.pl = -1//玩家的车上的位置参数初始化
entity.player.invisible = false//显示玩家
entity.player.showName = true//显示名字
entity.player.cameraEntity = entity//视角回归
entity.player.cameraEntity.enableDamage = !seat_count(entity.player.cameraEntity);//如果车上没人,则车关掉受伤害(避免bug发生)
}
}
}
})
async function yd() {//重复判断
world.querySelectorAll('.载具').forEach((e) => {//查找载具
if (e.carmd[0] != '无') {//如果载具有驾驶员
const entity = world.querySelectorAll('player').filter(a => a.player.name === e.carmd[0])[0]//查找驾驶员
drive(entity, e)//驾驶员开车
}
if (e.position.y <= -10) {//如果车的y坐标小于-10
e.hurt(e.hp, {//车喵
attacker: e,
})
}
})
await sleep(喵)
yd()
}
yd()
async function drive(entity, plane) {//载具移动
if (entity.player.walkState == Box喵layerWalkState.RUN || entity.player.walkState == Box喵layerWalkState.WALK) {//前进时加速
if (plane.speed < plane.maxspeed) {//如果速度小于最高速度
plane.speed += plane.quicken//增加加速度
}
}
else {//否则
if (plane.speed >= plane.quicken) {//如果车的速度大于加速度(不是0为避免bug发生)
plane.speed -= plane.quicken//减一个加速度的值
}
}
if (plane.speed < plane.quicken) {//如果即将发生bug
plane.speed = 0;//将车速设置成0,避免bug发生
}
plane.direction = Math.atan2(entity.player.facingDirection.z, entity.player.facingDirection.x)//设置车的朝向参数(主意,不是朝向)
drive1(plane, plane.direction);//判断方向向量
plane.velocity.set(//速度设置
Math.cos(plane.angle) * plane.speed,//三角学函数cos向量乘速度
0,
Math.sin(plane.angle) * plane.speed//三角学函数sin向量乘速度
);
plane.meshOrientation = plane.quat.rotateY(PI3).rotateZ(0).rotateX(0).rotateY(plane.angle);//设置朝向
}
function drive1(entity, direction) {//方向向量判断
let angle1 = direction;//设置angle1为朝向参数
if (angle1 < 0) {//如果小于0
angle1 = PI2 + angle1;//那么就增加一个PI2
}
if (entity.angle < 0) {//如果车的朝向小于0
entity.angle = PI2 + entity.angle;//车的朝向增加PI2
}
entity.angle %= PI2;//车的朝向模一个PI2
const angle2 = entity.angle;//设置angle2为车目前的朝向
if (Math.min(Math.abs(angle1 - angle2), Math.abs(PI2 - angle1 + angle2)) < 0.1) {//一个判断,如果玩家和车的朝向一样
entity.angle = entity.direction;//那么车的朝向设置成车的朝向
}
else {//否则
if (angle1 > angle2) {//如果angle1大于2
if (angle1 - angle2 < Math.PI) {//如果差小于Math.PI
entity.angle += entity.sensitive * entity.speed;//那么就将方向增加灵敏度乘速度
}
else {
entity.angle -= entity.sensitive * entity.speed;//将方向向量减少灵敏度乘速度
}
}
else {
if (angle1 + (PI2 - angle2) < Math.PI) {//如果angle1加上PI2-angle2的差小于Math.PI
entity.angle += entity.sensitive * entity.speed;//方向向量增加灵敏度乘速度
}
else {
entity.angle -= entity.sensitive * entity.speed;//减少灵敏度乘速度
}
}
}
}
function randint(a, b) {//随机整数代码
if (Math.random() > (b - a) / a) {
return b
} else {
return Math.ceil(Math.random() * (b - a) + a)
}
}2023-01-06T16:11:38 点赞:0
在 关键词收集!!!(●)`Ⅴ´(●) 中回复
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
https://box3.codemao.cn/e/797958d1409d4b768347
2023-01-08T14:05:58 点赞:0