Java(Android)游戏开发框架LGame-027发布

上传人:飞*** 文档编号:44889592 上传时间:2018-06-14 格式:DOCX 页数:14 大小:1.72MB
返回 下载 相关 举报
Java(Android)游戏开发框架LGame-027发布_第1页
第1页 / 共14页
Java(Android)游戏开发框架LGame-027发布_第2页
第2页 / 共14页
Java(Android)游戏开发框架LGame-027发布_第3页
第3页 / 共14页
Java(Android)游戏开发框架LGame-027发布_第4页
第4页 / 共14页
Java(Android)游戏开发框架LGame-027发布_第5页
第5页 / 共14页
点击查看更多>>
资源描述

《Java(Android)游戏开发框架LGame-027发布》由会员分享,可在线阅读,更多相关《Java(Android)游戏开发框架LGame-027发布(14页珍藏版)》请在金锄头文库上搜索。

1、2010-08-19 更新内容:更新内容:1、针对 Android 版增加了多点触摸支持。2、增加了一组模拟按钮,以 Screen 实现 Emulator 监听(此监听器对应 8 种按钮事件) 即可直接使用。3、增加了一些细节处的功能扩展,譬如 Android 版 LSystem 类已和 JavaSE 版一样提 供了大量系统环境参数。4、修正了某些环境会遇到的中文乱码问题以及新发现的框架 BUG(旧版 LGraphics 类仿 J2ME 实现部分有 BUG,建议更新此版)。源码及 jar 下载地址: http:/loon- 版启动函数变更:版启动函数变更:在 0.2.7 版中,略微变更了游戏初

2、始化方式,入口函数改为 onMain。view plaincopy to clipboardprint?1.public class Main extends LGameAndroid2DActivity 2. 3. public void onMain() 4. /this.initialization(false,LAD.LEFT, “Admob ID“,60); 5. this.initialization(false); 6. this.setShowLogo(false); 7. this.setScreen(new EmulatorTest(); 8. this.setFPS(50

3、); 9. this.setShowFPS(true); 10. this.showScreen(); 11. 12. 新增模拟按钮的使用新增模拟按钮的使用 :为了适应复杂操作环境及格斗游戏需要,特为 Android 及 JavaSE 版 LGame 新增一组模 拟按钮,在任意 Screen 中实现 EmulatorListener 监听即可调用。基本使用方式如下:view plaincopy to clipboardprint?1.package org.loon.test; 2.import org.loon.framework.android.game.action.sprite.Col

4、orBackground; 3.import org.loon.framework.android.game.core.EmulatorListener; 4.import org.loon.framework.android.game.core.graphics.LColor; 5.import org.loon.framework.android.game.core.graphics.Screen; 6.import org.loon.framework.android.game.core.graphics.device.LGraphics; 7.import android.view.K

5、eyEvent; 8.import android.view.MotionEvent; 9./所有的 Screen(Screen、ThreadScreen、CanvasScreen)只要实现 EmulatorListener监听, 10. /即会自动调用模拟按键。 11. public class EmulatorTest extends Screen implements EmulatorListener 12. private ColorBackground background; 13. public EmulatorTest() 14. /通过 getEmulatorButtons 函

6、数可以返回当前模拟按钮的数组集合。 15. /getEmulatorButtons(); 16. 17. / 0.2.7 版新增函数,会在 Screen 构建完成后执行并加载其中数据 18. public void onLoad() 19. / 制作一块红色的背景,大小为 48x48 20. this.background = new ColorBackground(LColor.red, 48, 48); 21. / 居中(ColorBackground 本身为精灵) 22. this.centerOn(background); 23. / 加载 24. this.add(backgroun

7、d); 25. 26. public void draw(LGraphics g) 27. 28. / 0.2.7 版新增函数,仿照 rokon 同名函数构建,仅在支持多点触摸的环境中才能被触发。29. public void onTouch(float x, float y, MotionEvent e, int pointerCount, 30. int pointerId) 31. 32. public boolean onKeyDown(int keyCode, KeyEvent e) 33. return true; 34. 35. public boolean onKeyUp(in

8、t keyCode, KeyEvent e) 36. return true; 37. 38. public boolean onTouchDown(MotionEvent e) 39. return true; 40. 41. public boolean onTouchMove(MotionEvent e) 42. return true; 43. 44. public boolean onTouchUp(MotionEvent e) 45. return true; 46. 47. public void onUpClick() 48. if (background != null) 4

9、9. background.move_up(4); 50. 51. 52. public void onDownClick() 53. if (background != null) 54. background.move_down(4); 55. 56. 57. public void onLeftClick() 58. if (background != null) 59. background.move_left(4); 60. 61. 62. public void onRightClick() 63. if (background != null) 64. background.mo

10、ve_right(4); 65. 66. 67. public void onCancelClick() 68. if (background != null) 69. background.setVisible(false); 70. 71. 72. public void onCircleClick() 73. 74. 75. public void onSquareClick() 76. 77. public void onTriangleClick() 78. if (background != null) 79. background.setVisible(true); 80. 81

11、. 82. public void unCancelClick() 83. 84. public void unCircleClick() 85. 86. public void unDownClick() 87. 88. public void unLeftClick() 89. 90. public void unRightClick() 91. 92. public void unSquareClick() 93. 94. public void unTriangleClick() 95. 96. public void unUpClick() 97. 用新增的模拟按键可以轻松实现格斗类或需要复杂操作的游戏:框架基本使用方法请参见此文:框架基本使用方法请参见此文:http:/ LGame 发布版本获得):以下为 LGame-Simple 开发的部分游戏示例画面。源码及 jar 下载地址: http:/loon-

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号