简体   繁体   English

如何为手机开发Java游戏?

[英]How do I develop Java games for phones?

How do I begin developing J2ME games for mobile phones? 我如何开始为手机开发J2ME游戏?

  1. Are any libraries available that can render pixel fonts for text? 是否有可用于渲染文本像素字体的库? - for text games - 用于文字游戏
  2. Are 2D graphic libraries available that can draw animated bitmaps? 2D图形库是否可用于绘制动画位图? - for isometric and tiled games - 等距平铺游戏
  3. Any are 3D engines available with texture mapping & lighting? 任何3D引擎都可以使用纹理贴图和照明吗? -- for racing and flying simulators - 用于赛车飞行模拟器

And regarding screen sizes: 关于屏幕尺寸:

  • What screen size to choose initially for good market penetration? 最初选择什么屏幕尺寸以获得良好的市场渗透?
  • How to manage game source code, in different screen sizes? 如何管理不同屏幕尺寸的游戏源代码? Make separate branches? 分开分支?

I'm new to J2ME programming, so any links you can give me to start off would be great. 我是J2ME编程的新手,所以你可以给我开始的任何链接都会很棒。

游戏编程速成课程开始开发简单的位图游戏。

Screen size of 240x320 pixels is where most j2me-enabled phones are these days. 屏幕尺寸为240x320像素,是目前大多数支持j2me的手机。

Obviously, touchscreen phones usually have bigger screens than this. 显然,触摸屏手机通常拥有比这更大的屏幕。 A VGA size of 480x640 is just around the corner for high-end phones. 高端手机的VGA尺寸为480x640即将到来。

Different screen sizes are usually handled by having generic code that can handle any screen size and can modify layout depending on in-Jar configuration files. 通常通过具有可以处理任何屏幕大小的通用代码来处理不同的屏幕大小,并且可以根据in-Jar配置文件来修改布局。 You then simply make several jar files, all containing the same compiled code but different values in the configuration files. 然后,您只需创建几个jar文件,这些文件都包含相同的编译代码,但配置文件中的值不同。

For 3D graphics, a lot of phones these days support http://www.jcp.org/en/jsr/detail?id=184 . 对于3D图形,如今许多手机都支持http://www.jcp.org/en/jsr/detail?id=184

Recent Sony-Ericsson phones also have http://www.jcp.org/en/jsr/detail?id=239 which should be easier to use if you already know OpenGL. 最近的索尼爱立信手机也有http://www.jcp.org/en/jsr/detail?id=239 ,如果您已经了解OpenGL,它应该更容易使用。 3D performances vary widly between phones that contain a hardware accelerator chip and those that don't. 包含硬件加速器芯片的手机和不包含硬件加速器芯片的手机之间的3D性能差异很大。

Animated bitmaps on J2ME usually means making you're own redrawing thread to refresh the screen. J2ME上的动画位图通常意味着让你自己重绘线程来刷新屏幕。 The only image format officially supported by the MIDP specification is PNG. MIDP规范正式支持的唯一图像格式是PNG。

Because of this last fact, if you want to create your own pixel font, you are pretty much going to need to have each character in a PNG image. 由于这最后一个事实,如果你想创建自己的像素字体,你几乎需要在PNG图像中包含每个字符。

You might want to look at LWUIT, an open source library published by Sun. 您可能想看一下Sun发布的开源库LWUIT。

I know this isn't a direct answer to your question, but I think J2ME is slowly on the decline, and Android is taking its place. 我知道这不是你问题的直接答案,但我认为J2ME正在慢慢走下坡路,而Android正在取而代之。 You may want to take a look at the iPhone as well, even though it's not Java. 您可能也想看看iPhone,即使它不是Java。 For the iPhone, you're looking at 480x320 screen size and you can use Cocos2D for the 2D games. 对于iPhone,你看的是480x320的屏幕尺寸,你可以使用Cocos2D进行2D游戏。

Also check out Kevin Glass's website , which has a lot of notes about 3-way instantaneous deployment to Applet, Android, and iPhone. 还可以访问Kevin Glass的网站 ,该网站有很多关于Applet,Android和iPhone的3路即时部署的说明。 More details are here . 更多细节在这里

There's this incredible list of open source J2ME libraries that do all sorts of things, like UI, Graphics, Games, 3D, Bluetooth, SMS, IM, Math, Security, Databases, XML .. even Dev Tools. 这个令人难以置信的开源J2ME库列表可以处理各种各样的事情,比如UI,图形,游戏,3D,蓝牙,SMS,IM,数学,安全,数据库,XML甚至开发工具。

Java ME Open Source Software - ngPhone Java ME开源软件 - ngPhone

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM