
Lv.1
签名:主营神奇代码岛,这个号是用来看帖子和发贴子的
在 【API 教程三连更】 吉吉喵化身电工师傅 中回复
我竟然做出来了!
const elevator = world.querySelector('#作弊电梯-1') // 获取电梯地板实体
elevator.collides = true // 电梯开启碰撞检测
elevator.fixed = true // 电梯不受外力影响
world.onEntityContact(({entity, other})=>{ // 实时监测整个世界的实体碰撞事件。entity指被碰撞的实体, other则是主动撞过来的实体
if(entity.id=='作弊电梯-1' && other.isPlayer){ // 如果 玩家踏上了电梯
if(entity.position.y<212121){ // 如果玩家y低于2楼地板, 则判定玩家在1楼
entity.velocity.y = 0.5 // 电梯持续上移
world.say(other.player.name+' 坐电梯上天')
entity.hp=entity.maxHp
}
}
})
world.onTick(()=>{ // 实时检测电梯位置, 进行检测是否到达1楼或2楼
if(elevator.position.y>127 ){ // 如果电梯y坐标高于2楼的地板, 电梯到达2楼
elevator.position.y = 125 // 复位到2楼的准确位置
elevator.velocity.y = 0 // 电梯停止移动
elevator.velocity.y =(0-0.95)
}else if(elevator.position.y<47){
elevator.velocity.y=51
elevator.velocity.y=0
elevator.velocity.y=0.5
}
}
)2021-10-23T17:39:02 点赞:1
在 【BOX3】这是什么? 中回复
我也不知道,在线等。imgsrc="http://img.t.sinajs.cn/t4/appstyle/expression/ext/normal/0b/tootha_thumb.gif"alt="emotion_嘻嘻"
2021-11-07T18:09:44 点赞:0
在 【神岛】这是干什么用的 中回复
添加代码标签的呀。 imgsrc="https://static.codemao.cn/emotion/thunder_monkey/%E7%AC%91%E8%B6%B4240.gif"alt="emotion_雷电猴_笑趴"
2021-11-14T13:08:29 点赞:0
在 第一次当吉吉喵,体验良好! 中回复
怎么回事??? imgsrc="https://static.codemao.cn/emotion/thunder_monkey/%E9%9B%B7%E7%94%B5%E7%8C%B4%E7%96%91%E9%97%AE.gif"alt="emotion_雷电猴_疑问"
2021-11-27T09:37:59 点赞:0
在 灌水帖(: 中回复
https://box3.codemao.cn/e/f79fd08acb5bdfc9ebde?p=OWSQZ8ZysHap%2Bhu9AlwEwfc8w9AiOKYyZRlAPQQAV1A8HEyVHZLwVndWVzdA%3D%3D
2021-12-07T21:19:00 点赞:0