
Lv.1
awq的一天
在 找一位代码师人类一败涂地 中回复
顶
顶顶
顶顶顶
顶顶顶顶
顶顶顶顶顶
顶顶喵再顶
顶顶顶顶顶顶顶
顶顶顶顶顶顶顶顶顶
顶顶顶顶顶顶顶
顶顶顶顶顶顶
顶顶顶顶顶
顶顶顶顶
顶顶顶
顶顶
顶顶
顶顶
顶顶顶
顶顶顶顶
顶顶顶顶顶
顶顶喵再顶
顶顶顶顶顶顶顶
顶顶顶顶顶顶顶顶顶
顶顶顶顶顶顶顶
顶顶顶顶顶顶
顶顶顶顶顶
顶顶顶顶
顶顶顶
顶顶
顶顶
顶顶
顶顶顶
顶顶顶顶
顶顶顶顶顶
顶顶喵再顶
顶顶顶顶顶顶顶
顶顶顶顶顶顶顶顶顶
顶顶顶顶顶顶顶
顶顶顶顶顶顶
顶顶顶顶顶
顶顶顶顶
顶顶顶
顶顶
顶顶
顶顶
顶顶顶
顶顶顶顶
顶顶顶顶顶
顶顶喵再顶
顶顶顶顶顶顶顶
顶顶顶顶顶顶顶顶顶
顶顶顶顶顶顶顶
顶顶顶顶顶顶
顶顶顶顶顶
顶顶顶顶
顶顶顶
顶顶
顶
2022-04-15T12:11:38 点赞:0
在 【特效教程】如何做出像元气骑士那样的彩虹武器发射特效 中回复
world.onPlayerJoin(({ entity }) => { //当玩家进入地图时
if (entity.player.name === '搬砖喵' || entity.player.name === '吉吉喵') {
entity.addTag('ghost') //本喵不受攻击
}
entity.enableDamage = true //允许这个玩家受伤
entity.id = entity.player.userKey//把userKey作为玩家的id
world.addCollisionFilter('#' + entity.id, '#' + entity.id)//让id跟玩家id一样的实体不会相互碰撞, 比如玩家的飞刀不会碰到玩家, 自己的飞刀之间也不会碰撞
})
world.addCollisionFilter('.ghost', '*')
world.onPlayerLeave(({ entity }) => { //当玩家离开地图时
world.removeCollisionFilter('#' + entity.id, '#' + entity.id)//取消这个玩家的碰撞过滤器
})
const SHANGHAI = [3, 5]//伤害随机数
const Quat = new Box3Quaternion(0, 0, 0, 1);//不懂得不是人(doge)
const DAO = [0.1 / 16, 0.1 / 16, 0.1 / 16] //正常的模型缩放比例
world.onPress(async ({ entity, button }) => {
if (button === 'action0' ) {
//彩虹特效(分为两部分:1.发射子弹代码[子弹用的是光球]2.尾部有彩虹特效粒子)
//以下部分实现的是发射子弹
const d = entity.player.facingDirection //玩家的朝向
const knife = world.createEntity({
mesh: 'mesh/光球.vb',
meshScale: DAO,
collides: true, // 开启碰撞
gravity: false, // 不受重力影响
position: entity.position, // 在玩家的位置生成飞刀
velocity: d.scale(2), // 飞刀的初速度是玩家朝向向量的2倍
meshOrientation: Quat.rotateY(Math.atan2(d.z, d.x)),
})
const caihongtexiao = [knife];
for (const e of caihongtexiao) {
Object.assign(
e, {
particleLimit: 30,
particleLifetime: 5,
particleRate: 30,
particleRateSpread: 30,
particleSize: [5, 3, 5, 3, 5],
particleColor: [
new Box3RGBColor(10, 0, 0),
new Box3RGBColor(0, 10, 0),
new Box3RGBColor(0, 0, 10),
], // 设置颜色(紫色)
particleVelocity: new Box3Vector3(0, 0, 0)
}
)
}
knife.id = entity.player.userKey //将小刀的id设置成玩家userKey, 便于碰撞过滤器识别
knife.onEntityContact(({ other }) => {//每当飞刀碰到另一个实体
other.hurt(SHANGHAI[Math.floor(Math.random() * SHANGHAI.length)])//被碰实体受随机伤害(这里的随机指3或5点伤害)
})
await sleep(2000)//等2秒后
knife.destroy()//清除模型, 防止模型数量太多超过服务器负载
}
})2022-04-18T11:00:19 点赞:0
在 【特效教程】如何做出像元气骑士那样的彩虹武器发射特效 中回复
world.onPlayerJoin(({ entity }) => { //当玩家进入地图时
if (entity.player.name === '搬砖喵' || entity.player.name === '吉吉喵') {
entity.addTag('ghost') //本喵不受攻击
}
entity.enableDamage = true //允许这个玩家受伤
entity.id = entity.player.userKey//把userKey作为玩家的id
world.addCollisionFilter('#' + entity.id, '#' + entity.id)//让id跟玩家id一样的实体不会相互碰撞, 比如玩家的飞刀不会碰到玩家, 自己的飞刀之间也不会碰撞
})
world.addCollisionFilter('.ghost', '*')
world.onPlayerLeave(({ entity }) => { //当玩家离开地图时
world.removeCollisionFilter('#' + entity.id, '#' + entity.id)//取消这个玩家的碰撞过滤器
})
const SHANGHAI = [3, 5]//伤害随机数
const Quat = new Box3Quaternion(0, 0, 0, 1);//不懂得不是人(doge)
const DAO = [0.1 / 16, 0.1 / 16, 0.1 / 16] //正常的模型缩放比例
world.onPress(async ({ entity, button }) => {
if (button === 'action0' ) {
//彩虹特效(分为两部分:1.发射子弹代码[子弹用的是光球]2.尾部有彩虹特效粒子)
//以下部分实现的是发射子弹
const d = entity.player.facingDirection //玩家的朝向
const knife = world.createEntity({
mesh: 'mesh/光球.vb',
meshScale: DAO,
collides: true, // 开启碰撞
gravity: false, // 不受重力影响
position: entity.position, // 在玩家的位置生成飞刀
velocity: d.scale(2), // 飞刀的初速度是玩家朝向向量的2倍
meshOrientation: Quat.rotateY(Math.atan2(d.z, d.x)),
})
const caihongtexiao = [knife];
for (const e of caihongtexiao) {
Object.assign(
e, {
particleLimit: 30,
particleLifetime: 5,
particleRate: 30,
particleRateSpread: 30,
particleSize: [5, 3, 5, 3, 5],
particleColor: [
new Box3RGBColor(10, 0, 0),
new Box3RGBColor(0, 10, 0),
new Box3RGBColor(0, 0, 10),
], // 设置颜色(紫色)
particleVelocity: new Box3Vector3(0, 0, 0)
}
)
}
knife.id = entity.player.userKey //将小刀的id设置成玩家userKey, 便于碰撞过滤器识别
knife.onEntityContact(({ other }) => {//每当飞刀碰到另一个实体
other.hurt(SHANGHAI[Math.floor(Math.random() * SHANGHAI.length)])//被碰实体受随机伤害(这里的随机指3或5点伤害)
})
await sleep(2000)//等2秒后
knife.destroy()//清除模型, 防止模型数量太多超过服务器负载
}
})world.onPlayerJoin(({ entity }) => { //当玩家进入地图时
if (entity.player.name === '搬砖喵' || entity.player.name === '吉吉喵') {
entity.addTag('ghost') //本喵不受攻击
}
entity.enableDamage = true //允许这个玩家受伤
entity.id = entity.player.userKey//把userKey作为玩家的id
world.addCollisionFilter('#' + entity.id, '#' + entity.id)//让id跟玩家id一样的实体不会相互碰撞, 比如玩家的飞刀不会碰到玩家, 自己的飞刀之间也不会碰撞
})
world.addCollisionFilter('.ghost', '*')
world.onPlayerLeave(({ entity }) => { //当玩家离开地图时
world.removeCollisionFilter('#' + entity.id, '#' + entity.id)//取消这个玩家的碰撞过滤器
})
const SHANGHAI = [3, 5]//伤害随机数
const Quat = new Box3Quaternion(0, 0, 0, 1);//不懂得不是人(doge)
const DAO = [0.1 / 16, 0.1 / 16, 0.1 / 16] //正常的模型缩放比例
world.onPress(async ({ entity, button }) => {
if (button === 'action0' ) {
//彩虹特效(分为两部分:1.发射子弹代码[子弹用的是光球]2.尾部有彩虹特效粒子)
//以下部分实现的是发射子弹
const d = entity.player.facingDirection //玩家的朝向
const knife = world.createEntity({
mesh: 'mesh/光球.vb',
meshScale: DAO,
collides: true, // 开启碰撞
gravity: false, // 不受重力影响
position: entity.position, // 在玩家的位置生成飞刀
velocity: d.scale(2), // 飞刀的初速度是玩家朝向向量的2倍
meshOrientation: Quat.rotateY(Math.atan2(d.z, d.x)),
})
const caihongtexiao = [knife];
for (const e of caihongtexiao) {
Object.assign(
e, {
particleLimit: 30,
particleLifetime: 5,
particleRate: 30,
particleRateSpread: 30,
particleSize: [5, 3, 5, 3, 5],
particleColor: [
new Box3RGBColor(10, 0, 0),
new Box3RGBColor(0, 10, 0),
new Box3RGBColor(0, 0, 10),
], // 设置颜色(紫色)
particleVelocity: new Box3Vector3(0, 0, 0)
}
)
}
knife.id = entity.player.userKey //将小刀的id设置成玩家userKey, 便于碰撞过滤器识别
knife.onEntityContact(({ other }) => {//每当飞刀碰到另一个实体
other.hurt(SHANGHAI[Math.floor(Math.random() * SHANGHAI.length)])//被碰实体受随机伤害(这里的随机指3或5点伤害)
})
await sleep(2000)//等2秒后
knife.destroy()//清除模型, 防止模型数量太多超过服务器负载
}
})2022-04-18T11:00:32 点赞:0
在 一个好消息和一个坏消息,你想先听哪个? 中回复
啊.....我还以为是现在的事情呢,,,结果点进去看,,,,是,,,,6个月前的...........
2022-04-18T11:02:27 点赞:3
在 【新手教程】如何在地图中增加商店(不含SQL,难度不大),大佬勿进…… 中回复
world.onPlayerJoin(({entity}) => {// 当玩家进入地图
entity.coin = 5 // 初始化玩家金币为5
})
const shop = world.querySelector('#服务员')
shop.enableInteract = true // 让服务员可以互动
shop.interactRadius = 5 // 设置互动范围
shop.interactHint = `商人` // 当玩家靠近时出现的提示语
shop.onInteract(async({entity}) => { // 当玩家与服务员互动
const buy = await entity.player.dialog({ // 弹出对话框
type: Box3DialogType.SELECT, // 选项框类型为单选
title: `商店`, // 标题
content: `有什么想买的吗?您有${entity.coin}金币`, // 提示玩家目前的金币数量
options: ['有BUG的代码 2金币/段', '喵 5金币/次'], // 给出商品列表
})
if (!buy || buy == null) return; // 如果玩家按下了×,跳过后面的代码,避免报错
switch(buy.index){
case 0:
if (entity.coin < 2){
entity.player.directMessage(`金币不足!`) // 提示玩家金币不够
} else {
entity.coin -= 2 // 减去玩家金币
entity.bug = 1 // 给玩家商品(下同)
entity.player.directMessage(`购买成功!`) // 提示玩家(下同)
}
break;
case 1:
if (entity.coin < 5){
entity.player.directMessage(`金币不足!`)
} else {
entity.coin -= 5
entity.enableDamage = true
entity.hurt(10000)
entity.player.directMessage(`购买成功!`)
}
break;
default:
// 注意:在使用switch语句时,别忘记了break和default
}
})2022-04-18T20:31:17 点赞:0
在 科技之城招人了! 中回复
请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图请勿毁图
2022-04-19T16:10:57 点赞:0
在 教程:背包换武器 勿喷! 中回复
world.onPress(async({ button, entity }) => { if(button != Box3ButtonType.ACTION1 || !entity.isPlayer || entity.player.dead) return; const result = await entity.player.dialog({ type: Box3DialogType.SELECT, title: `${entity.player.name}的状态`, options: ['切换武器','切换视角','脱离卡点'], });
if (!result || result === null) return; // 判断玩家选了什么选项。 switch (result.index) { case 0:
const result = await entity.player.dialog({ type: Box3DialogType.SELECT, content: `切换魔法`, options: ['剑','剑之刃','蓝之剑','圣之法杖','冰——喵','法仗','星月权杖','穹破刀','弓'] });
if (!result || result === null) return;
switch (result.index) { case 0: entity.fashuy = 1 entity.fashu = `剑` entity.act = 90 const handWears = entity.player.wearables(Box3BodyPart.RIGHT_HAND); entity.player.removeWearable(handWears[0]); entity.player.directMessage(`切换成功`) entity.player.addWearable({ bodyPart: Box3BodyPart.RIGHT_HAND, mesh: 'mesh/剑.vb', orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI/2), scale: new Box3Vector3(0.4, 0.7, 0.4), offset: new Box3Vector3(-0.05, 0.4 ,1.4),
}); break; case 1: entity. fashuy = 2 entity.fashu = `剑之刃` entity.act = 120 const handWears1 = entity.player.wearables(Box3BodyPart.RIGHT_HAND); entity.player.removeWearable(handWears1[0]); entity.player.directMessage(`切换成功`); entity.player.addWearable({ bodyPart: Box3BodyPart.RIGHT_HAND, mesh: 'mesh/剑之刃.vb', orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI/2), offset: new Box3Vector3(-0.05, 0.4 ,1.4), });
break; case 2: entity.fashu = `蓝之剑` entity.act = 105 const handWears2 = entity.player.wearables(Box3BodyPart.RIGHT_HAND); entity.player.removeWearable(handWears2[0]); entity.player.directMessage(`切换成功`) entity.player.addWearable({ bodyPart: Box3BodyPart.RIGHT_HAND, mesh: 'mesh/蓝之剑.vb', orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI/2), scale: new Box3Vector3(0.4, 0.7, 0.4), offset: new Box3Vector3(-0.05, 0.4 ,1), });
break; case 3: entity.fashu = `圣之法杖` entity.act = 130 const handWears3 = entity.player.wearables(Box3BodyPart.RIGHT_HAND); entity.player.removeWearable(handWears3[0]); entity.player.directMessage(`切换成功`) entity.player.addWearable({ bodyPart: Box3BodyPart.RIGHT_HAND, mesh: 'mesh/圣之法杖.vb', orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI/2.5), scale: new Box3Vector3(0.4, 0.7, 0.4), offset: new Box3Vector3(-0.05, 0.2 ,0.4) });
break; case 4: entity.fashu = `冰——喵` entity.act = 150 const handWears4 = entity.player.wearables(Box3BodyPart.RIGHT_HAND); entity.player.removeWearable(handWears4[0]); entity.player.directMessage(`切换成功`) entity.player.addWearable({ bodyPart: Box3BodyPart.RIGHT_HAND, mesh: 'mesh/冰——喵.vb', orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI/2), scale: new Box3Vector3(0.4, 0.7, 0.4), offset: new Box3Vector3(-0.05, 0.4 ,1), }); break; case 5: entity.fashu = `法仗` entity.act = 170 const handWears5= entity.player.wearables(Box3BodyPart.RIGHT_HAND); entity.player.removeWearable(handWears5[0]); entity.player.directMessage(`切换成功`) entity.player.addWearable({ bodyPart: Box3BodyPart.RIGHT_HAND, mesh:'mesh/法仗.vb', orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI/2), scale: new Box3Vector3(0.4, 0.7, 0.4), offset: new Box3Vector3(-0.05, 0.4 ,1), }); break; case 6: entity.fashu = `星月权杖` entity.act = 125 const handWears6 = entity.player.wearables(Box3BodyPart.RIGHT_HAND); entity.player.removeWearable(handWears6[0]); entity.player.directMessage(`切换成功`) entity.player.addWearable({ bodyPart: Box3BodyPart.RIGHT_HAND, mesh: 'mesh/星月权杖.vb', orientation: new Box3Quaternion(0, 1, -3, 9).rotateY(Math.PI/2), scale: new Box3Vector3(0.4, 0.55, 0.4), offset: new Box3Vector3(0, 0.7 ,0.6), }); break; case 7: entity.fashu = `穹破刀` entity.act = 135 const handWears7 = entity.player.wearables(Box3BodyPart.RIGHT_HAND); entity.player.removeWearable(handWears7[0]); entity.player.directMessage(`切换成功`) entity.player.addWearable({ bodyPart: Box3BodyPart.RIGHT_HAND, mesh: 'mesh/穹破刀.vb', orientation: new Box3Quaternion(0.4, 1.3, 0.5).rotateY(Math.PI/2), scale: new Box3Vector3(0.4, 0.7, 0.4), offset: new Box3Vector3(-0.05, 0.4 ,1), }); } break; case 1: const result1 = await entity.player.dialog({ type: Box3DialogType.SELECT, title: `${entity.player.name}的状态`, content: `视角切换`, options: ['第一人称','第三人称'] });
if (!result1 || result1=== null) return;
switch (result1.index) { case 0: entity.player.cameraMode = 'FPS' break;
case 1: entity.player.cameraMode = 'FOLLOW' break; default: } case 2: entity.position.set(54,10,58) break; default: } });
world.onPlayerJoin(({ entity }) => { Object.assign(entity, { particleRate: 7, particleSize: [2, 4, 8, 4, 10], particleColor: [ new Box3RGBColor(10, 9, 2), new Box3RGBColor(5, 0.25, 0.1), new Box3RGBColor(3, 0.05, 0.05), new Box3RGBColor(0, 0, 0), new Box3RGBColor(0, 0, 0), ], particleLifetime: 1, particleVelocitySpread: new Box3Vector3(2, 2, 2), }); });2022-04-20T12:24:04 点赞:0
在 神奇岛民第二期@传奇喵必看() 中回复
顶
顶顶
顶顶顶
顶顶顶顶
顶顶顶顶顶
顶顶顶顶顶顶
顶顶顶顶顶顶顶
顶顶顶顶顶顶顶顶
顶顶顶顶顶顶顶
顶顶顶顶顶顶
顶顶顶顶顶
顶顶顶顶
顶顶顶
顶顶
顶
2022-04-21T11:35:13 点赞:0
在 【box3】谁能提供长按左键将模型变大的代码? 中回复
world.onTick((t)=>{
if(t%10!=0)return;
world.querySelector("player").forEach((e)=>{
if(e.pkayer.action0Button)实体对象.meshScale.copy(实体对象.meshScale.scale(1.1))
})
})2022-04-21T19:05:39 点赞:0
在 圣 诞 皮 肤 代 码 公 开 ! ( 代 码 岛 3 . 0 ) 中回复
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2022-04-30T21:19:03 点赞:0