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

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

1. 其他引擎的Demo-Example_23 [ 100%]

...rameLoop(1, this, this.animate); } animate() { const Sprite = Laya.Sprite, Point = Laya.Point; let laser; if (tick > frequency) { tick = 0; // iterate through the dudes and update the positions laser = new Sprite(); laser.loadImage("res/pixi/laser0" + ((type % 5) + 1) + ".png"); type++; laser.life =...

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

2. 其他引擎的Demo-Example_05 [ 97%]

...1; var current = 0; var objs = 17; var vx = 0; var vy = 0; var vz = 0; var points1 = []; var points2 = []; var points3 = []; var tpoint1 = []; var tpoint2 = []; var tpoint3 = []; var balls = []; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser.height, WebGL); ...

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

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

.../ 游戏开始时有一个食物 this.produceFood(); } initSnake() { const Point = Laya.Point; for (let i = 0; i 0) { let prevSeg = segments[segments.length - 1]; seg.rotation = prevSeg.rotation; let point = seg.getPinPosition(); seg.x = prevSeg.x - point.x; seg.y = prevSeg.y - point.y; } segments.p...

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

4. 区块地图-等角地图 [ 96%]

... createMap() { const TiledMap = Laya.TiledMap, Rectangle = Laya.Rectangle, Point = Laya.Point; this.tiledMap = new TiledMap(); this.tiledMap.createMap("res/tiledMap/isometric_grass_and_water.json", new Rectangle(0, 0, Laya.stage.width, Laya.stage.height), Laya.Handler.create(this, this.mapLoaded), n...

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

5. 2D物理-仿生机器人 [ 87%]

...let chainCollider = ground.addComponent(Laya.ChainCollider); chainCollider.points = "50,200,50,570,1050,570,1050,200"; for (let i = 1; i 0) { legCollider1.points = p1.concat(p2).concat(p3).join(","); legCollider2.points = [0, 0].concat(B2Math.SubVV(p5, p4)).concat(B2Math.SubVV(p6, p4)).join(","); } ...

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

6. 鼠标交互-双指缩放(多点触控) [ 82%]

...this.onMouseMove); } /**计算两个触摸点之间的距离*/ getDistance(points) { let distance = 0; if (points && points.length == 2) { let dx = points[0].stageX - points[1].stageX; let dy = points[0].stageY - points[1].stageY; distance = Math.sqrt(dx * dx + dy * dy); } return distance; } } new I...

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

7. 2D物理-桥 [ 78%]

...let chainCollider = ground.addComponent(Laya.ChainCollider); chainCollider.points = "50,600,1050,600"; let point1 = new Laya.Sprite(); Laya.Laya.stage.addChild(point1); point1.pos(startPosX, startPosY); let pointRB1 = new Laya.RigidBody(); pointRB1.type = "static"; point1.addComponentIntance(pointRB...

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

8. UI-RefreshList [ 44%]

...a.WebGL; Animation = Laya.Animation; Label = Laya.Label; Text = Laya.Text; Point = Laya.Point; Tween = Laya.Tween; TextArea = Laya.TextArea; class UI_RefreshList { constructor() { this.baseBox = null; this.refreshLoading = null; this.loadingAni = null; this.loadingLabel = null; this.refreshList = nu...

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