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

大约有 14 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0041 秒)

1. 【简单跑酷--JS版】---Lv.3 添加地板 [ 100%]

...个素材是 32 * 20 拼起来的 this.y = 32 * 6 + 32 * parseInt(8 * Math.random()); if(this.bg == null){ //贴图纹理 this.bgTexture = Laya.loader.getRes("res/floor.png"); this.bg = new laya.display.Sprite(); this.bg.graphics.clear(); //将当前的坐标向上移动32 方便后面处理人物...

来源: Laya_社区 发布时间: 20160728

2. 点击区域问题 [ 88%]

...r() {     sp.graphics.clear();     var rc:number = Math.floor(Math.random()*0xffffff);     sp.graphics.drawRect(-50,-100,100,100,"#"+rc); } 这样多包几层,点击区域就会怪怪的,绘制的区域和点击区域不一样,不知道是不是我理解的有问题 2018-01-06 添...

来源: Laya_社区 发布时间: 20180106

3. 大神们能不能帮忙解决一下一些问题呀,一个新手搞不定呀 [ 85%]

...= [1,2,3,4,5,6,7]; if(第一关过关了){ var 随机数 = Math.floor(Math.random() * 未过的关数.length; var 新的未过的关数 = []; var 剩下关数 = 未过的关数.length - 1; for(var i =0;i<剩下关数;i++){ if(i != 随机数){ 新的未过的关数.push(未过的关数[i]); } } ...

来源: Laya_社区 发布时间: 20180615

4. 【简单跑酷--JS版】---Lv.6 终篇 [ 84%]

...个素材是 32 * 20 拼起来的 this.y = 32 * 6 + 32 * parseInt(8 * Math.random()); if(this.bg == null){ //贴图纹理 this.bgTexture = Laya.loader.getRes("res/floor.png"); this.bg = new laya.display.Sprite(); this.bg.graphics.clear(); this.addChild(this.bg); //因为上面的图片是截取的 ...

来源: Laya_社区 发布时间: 20160803

5. 为什么会出现报错 ani not found:ufo1_down [ 83%]

...ype === "enemy3"){ // 随机是子弹道具还是医疗包 var type = Math.random() < 0.7 ? 2 : 3; var item = Laya.Pool.getItemByClass("role",Role); // 初始化信息 item.init("ufo" + (type - 1),role.camp,1,1,15,type); // 设置位置 item.pos(role.x,role.y); // 添加到舞台上 Laya.stage.ad...

来源: Laya_社区 发布时间: 20170525

6. 为什么会出现报错 ani not found:ufo1_down [ 81%]

...ype === "enemy3"){ // 随机是子弹道具还是医疗包 var type = Math.random() < 0.7 ? 2 : 3; var item = Laya.Pool.getItemByClass("role",Role); // 初始化信息 item.init("ufo" + (type - 1),role.camp,1,1,15,type); // 设置位置 item.pos(role.x,role.y); // 添加到舞台上 Laya.stage.ad...

来源: Laya_社区 发布时间: 20170525

7. 微信小游戏提审后,提示说代码侵权 [ 79%]

...en, str.length - len - 1); console.log(name); let number = Math.floor(Math.random() * 9999); let name2; let lastIndex = name.lastIndexOf("_"); if(lastIndex == -1){ name2 = name + "_" + number; }else{ name2 = name.substr(0, lastIndex) + "_" + number; } let name2s = name2 + "("; //phpContent = phpCont...

来源: Laya_社区 发布时间: 20190613

8. 【简单跑酷--JS版】---Lv.5 玩家踩地板 [ 76%]

...个素材是 32 * 20 拼起来的 this.y = 32 * 6 + 32 * parseInt(8 * Math.random()); if(this.bg == null){ //贴图纹理 this.bgTexture = Laya.loader.getRes("res/floor.png"); this.bg = new laya.display.Sprite(); this.bg.graphics.clear(); this.addChild(this.bg); //因为上面的图片是截取的 ...

来源: Laya_社区 发布时间: 20160801

9. list随机生成图片优化 [ 75%]

list随机生成图片优化 var aa:int= Math.floor((Math.random()*4)+1); var bb:int; switch(aa) { case 1: bb=2; break; case 2: bb=4; break; case 3: bb=1; break; case 4: bb=3; break; } var img:Image = cell.getChildByName("img1") as Image; img.skin ="battle/xuanshangyu/Image_"+aa+"00"+bb+".png"; 一...

来源: Laya_社区 发布时间: 20170616

10. 为什么这个图片还是随机切换不了,新手求帮忙 [ 74%]

...  以下代码是用Image的skin来替换资源var index= Math.floor(Math.random()*num); var img= new Laya.Image(); Laya.stage.addChild(img); img.skin = "res/"+index+".png"; 2017-01-11 1 1 分享 微博 QZONE 微信 为什么被折叠? 0 个回复被折叠 要回复问题请先登录 发起人 Todo...

来源: Laya_社区 发布时间: 20170111