猫史档案馆


我困死了

我困死了

Lv.1

获赞:19收藏:1浏览:64作品收藏:1
回复帖子评论
上一页1 页 / 共 1下一页

代码岛3.0 中回复

aaa

2021-11-30T17:58:53 点赞:0

【岛3大更新】代码师、音效师,双厨狂喜! 中回复

const elevator = world.querySelector('#电梯板-1') //获取电梯板实体
elevator.fixed = true //不可推移
elevator.collides = true //可碰撞
const pos = elevator.position//电梯板原本的位置

const ani = elevator.animate([// 1+5+1+2=9, 总时间被切成9份
    { position: pos, duration: 1 },// 1/9 的时间停留在地面
    { position: pos, duration: 5 },// 5/9 的时间用于地面往楼顶移动
    { position: pos.add({ x: 0, y: 58, z: 0 }), duration: 1 },// 1/9 的时间停留在楼顶
    { position: pos.add({ x: 0, y: 58, z: 0 }), duration: 2 },// 2/9 的时间从楼顶回到地面
], {
    duration: 16 * 9, //播放一个循环共用时9秒(系统默认每秒16帧)
    iterations: 1,//动画只播放1次
    direction: Box3AnimationDirection.WRAP,//让动画实体从终点回到起点
})

world.onPress(({ entity, button }) => {
    if (button === Box3ButtonType.ACTION0) {//左键重新播放动画
        ani.play({
            duration: 16 * 9, //播放一个循环共用时9秒
            iterations: Infinity,//动画无限次循环播放
            direction: Box3AnimationDirection.WRAP,//让动画实体从终点回到起点
        })
    }
    else if (button === Box3ButtonType.ACTION1) {//右键停止动画
        ani.cancel()
    }
})

ani.onReady(() => {//当动画开始播放时
    world.say('电梯准备启动')
})

ani.onFinish(() => {//当动画结束播放时
    world.say('电梯自己停了')
})

2022-04-01T10:15:01 点赞:0

【岛3大更新】代码师、音效师,双厨狂喜! 中回复

const elevator = world.querySelector('#电梯板-1') //获取电梯板实体
elevator.fixed = true //不可推移
elevator.collides = true //可碰撞
const pos = elevator.position//电梯板原本的位置

const ani = elevator.animate([// 1+5+1+2=9, 总时间被切成9份
    { position: pos, duration: 1 },// 1/9 的时间停留在地面
    { position: pos, duration: 5 },// 5/9 的时间用于地面往楼顶移动
    { position: pos.add({ x: 0, y: 58, z: 0 }), duration: 1 },// 1/9 的时间停留在楼顶
    { position: pos.add({ x: 0, y: 58, z: 0 }), duration: 2 },// 2/9 的时间从楼顶回到地面
], {
    duration: 16 * 9, //播放一个循环共用时9秒(系统默认每秒16帧)
    iterations: 1,//动画只播放1次
    direction: Box3AnimationDirection.WRAP,//让动画实体从终点回到起点
})

world.onPress(({ entity, button }) => {
    if (button === Box3ButtonType.ACTION0) {//左键重新播放动画
        ani.play({
            duration: 16 * 9, //播放一个循环共用时9秒
            iterations: Infinity,//动画无限次循环播放
            direction: Box3AnimationDirection.WRAP,//让动画实体从终点回到起点
        })
    }
    else if (button === Box3ButtonType.ACTION1) {//右键停止动画
        ani.cancel()
    }
})

ani.onReady(() => {//当动画开始播放时
    world.say('电梯准备启动')
})

ani.onFinish(() => {//当动画结束播放时
    world.say('电梯自己停了')
})

2022-04-01T10:15:20 点赞:0

【香肠派对 v.24】 招第二批管喵啦! 中回复

我来

2022-08-04T08:49:11 点赞:0

【香肠派对 v.24】 招第二批管喵啦! 中回复

我想要反求求了

2022-08-04T08:49:25 点赞:0

【香肠派对 v.24】 招第二批管喵啦! 中回复

我来个人主页链接喵ao.cn/u/code6623994昵称:我困喵了

2022-08-04T09:38:32 点赞:0

【神奇代码岛】S2赛季即将到来,新职业提前推出! 中回复

yes,,我就是哔哩哔哩up主欧耶

 

2023-03-25T15:25:08 点赞:0