
Lv.1
你干嘛啊,哎呦喂( )( )中立既不是ikun也不是xiao黑子
在 【求助】函数怎么写? 中回复
//普通函数
function 函数名(参数){
执行代码
}
//异步函数
async function 函数名(参数){
执行代码
}
//匿名函数
let a = function (参数){//a为储存该函数的变量名
执行代码
}
//箭头函数
let a = (参数) =>{//a为储存该函数的变量名
执行代码
}2023-02-25T07:37:22 点赞:0
在 【神奇代码岛】首席建模师/剪辑师名单出炉,进击的创作者们! 中回复
阿吉,我的呢?https://box3.codemao.cn/v/50233040
https://box3.codemao.cn/v/50233078
https://box3.codemao.cn/v/50233095
2023-04-28T17:01:42 点赞:0
在 【神岛】如何检测实体碰撞 中回复
就是我想做攻击特效时创建个实体但不想开碰撞,求怎样检测到玩家与它碰撞(这样不知道能不能让你们听明白,我有点不怎么会解释了
)
2023-06-17T21:33:45 点赞:0
在 (求助)求代码! 中回复
是这样吧???
world.onPlayerJoin(({ entity }) => {//初始化
entity.item = ['奔驰']//可以自己添加
})
async function bag1(entity) {
let op = await entity.player.dialog({
type: 'select',//类型
title: '选择车辆',//对话框背景的字
content: '请选择',//可自行更改
options: entity.item//选择是entity.item
});
if (op) {
//想写的代码
}
};
async function bag2(entity) {
let bag = await entity.player.dialog({
type: 'select',//类型
title: '背包',//对话框背景的字
content: '请选择',//可自行更改
options: ['选择车辆']//
});
if (bag) {//如果是bag
if (bag.index == 0) {
bag1(entity);//调用函数
}
}
};
world.onPress(({ entity, button }) => {
if (button == Box3ButtonType.ACTION1) {//判断
bag2(entity);
}
})2023-07-08T13:34:02 点赞:0