• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 3 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0011 秒)

1. 输入设备-摇一摇 [ 100%]

...e'; console.leading = 10; } startShake() { const Shake = Laya.Shake; Shake.instance.start(5, 500); Shake.instance.on(Laya.Event.CHANGE, this, this.onShake); console.text = '开始接收设备摇动\n'; } onShake() { const Shake = Laya.Shake; shakeCount++; console.text += "设备摇晃了" + shakeCou...

来源: Laya2.0_示例 发布时间: 20240930

2. 输入设备-指南针 [ 66%]

...I(); // // 创建显示角度的文本 this.createDegreesText(); Gyroscope.instance.on(Event.CHANGE, this, this.onOrientationChange); } // 方位指示器指向当前所朝方位 createCompass() { const Sprite = Laya.Sprite; compassImg = new Sprite(); Laya.stage.addChild(compassImg); compassImg.load...

来源: Laya2.0_示例 发布时间: 20240930

3. 输入设备-贪吃蛇(重力感应) [ 65%]

...8"; // 初始化蛇 this.initSnake(); // 监视加速器状态 Accelerator.instance.on(Event.CHANGE, this, this.monitorAccelerator); // 游戏循环 Laya.timer.frameLoop(1, this, this.animate); // 食物生产 Laya.timer.loop(3000, this, this.produceFood); // 游戏开始时有一个食物 this.prod...

来源: Laya2.0_示例 发布时间: 20240930