1、 手持设备上网络游戏“贪食蛇”的实现 摘 要 J2ME(Java 2 Micro Edition) 是近年来随着各种不同设备,尤其是移动通 信设备的飞速发展而诞生的一项新的开发技术。它定位在消费性电子产品的应 用上,对设备的智能化、多样化,提供了革命性的解决方案。Java 良好的跨平 台特性在移动平台的开发中显示出了巨大的威力。Java 语言面向对象的优势也 使得游戏开发变得更容易。 随着手机的日益普及,以及手机性能的不断攀升。移动游戏潜在的市场比 其它任何游戏平台都要大。本论文着眼于 J2ME 技术的应用,利用 MIDP 2.0 提 供的强大的游戏开发能力,开发一款可商用的手机游戏程序贪食蛇
2、。本程 序通过函数重载,既实现了无线网络对战的要求也实现了进行单人游戏的功能。 游戏加入了难度调整,游戏纪录的存储以及实现了游戏背景音乐的播放,大大 增强了游戏的娱乐性和互动性。游戏提供了良好的界面,游戏 Logo,游戏帮助, 一应俱全,背景音乐可以随时暂停或开启,游戏可以随时暂停和继续,实现了 更为人性化的要求。 本论文介绍了基于移动平台的 Java无线网络游戏开发须具备的基础知识和 高级技巧,包括无线游戏的发展前景,主要开发工具的使用,J2ME 的相关技术 及本程序的结构分析和具体功能的实现等。 关键词:J2ME 贪食蛇 网络 Handheld devices on the realiza
3、tion of online gamesGreedSnake ABSTRACT J2ME is a kind of fast developing technology implemented on various devices especially mobile communication equipments. It focuses on application for consumptive electronic products, providing revolutionary solution to the intelligentization and diversificatio
4、n of the equipment. Java characteristics of a good cross-platform in the development of the mobile platform to display a great power. Java language of the advantages of object-oriented development also makes the game much easier. With the growing popularity of mobile phones, mobile phones and proper
5、ties of rising. Mobile gaming market potential than any other gaming platforms to major. The papers focus on J2ME technology applications, using MIDP 2.0 provide a powerful game development capabilities, the development of a commercial mobile phone can Games - GreedSnake. Heavy function through this
6、 process, we achieved a wireless network Versus the requirements for achieving a single-player features. The difficulty of adjusting to join the game, played records storage and the realization of the game background music player, greatly increased the games entertainment and interactive. Games provide a good interface, games Logo, to help the game, background music can be suspended at any time or open, games and continue to be suspended at any time, achieving a more humane requirements. T