Android 安卓。2D游戏开发

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11817789/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:56:30  来源:igfitidea点击:

Android. 2D game development

android

提问by AndreiBogdan

I would like to start developing a 2D game for Android, but i haven't got the slightest clue where to start. For instance, how are the Angry Birds games developed? I'm guessing it's a 2D engine or something?

我想开始为 Android 开发 2D 游戏,但我没有丝毫线索从哪里开始。例如,愤怒的小鸟游戏是如何开发的?我猜这是一个 2D 引擎还是什么?

Can anyone shed some light on the matter? Anything is appreciated as i have zero ideas on where to look first.

任何人都可以对此事有所了解吗?任何事情都值得赞赏,因为我对首先看哪里的想法为零。

采纳答案by Gio

I recommend LIBGDX

我推荐 LIBGDX

http://libgdx.badlogicgames.com/index.html

http://libgdx.badlogicgames.com/index.html

Open source, java, cross-platform, good support for Open-GL, lot's of examples and a good community.

开源、java、跨平台、对 Open-GL 的良好支持、大量示例和良好的社区。

回答by AndreiBogdan

I've used AndEngine extensively and I really like it BUT

我已经广泛使用 AndEngine 并且我真的很喜欢它但是

2D games - unless you have something really, really complicated in-mind (lots of physics and collision detection), I'd recommend you consider creating them in plain old HTML (HTML5, to be specific).

2D 游戏 - 除非你有一些非常非常复杂的想法(很多物理和碰撞检测),我建议你考虑用普通的旧 HTML(具体来说是 HTML5)来创建它们。

Why?

为什么?

Because HTML5 works pretty-much everywhere and there are some really decent toolkits for making more complex stuff (including level editors and basic physics stuff).

因为 HTML5 几乎可以在任何地方工作,并且有一些非常不错的工具包可以制作更复杂的东西(包括关卡编辑器和基本物理东西)。

Moreover, you can convert HTML5 into Apps for both Android, iOS and other platforms - e.g. your game will work pretty much everywhere with minimal extra effort. Using tools like Cordova(phonegap) even allows you to access things like cameras and tilt sensors in Apps created from your HTML5 code (Dolphin Browser on Android even allows those apps to run in the browser!)

此外,您可以将 HTML5 转换为适用于 Android、iOS 和其他平台的应用程序 - 例如,您的游戏几乎可以在任何地方运行,只需最少的额外工作。使用 Cordova(phonegap) 之类的工具,您甚至可以访问由 HTML5 代码创建的应用程序中的相机和倾斜传感器(Android 上的海豚浏览器甚至允许这些应用程序在浏览器中运行!)

If you do want fancier stuff, Corona is pretty decent and easy to learn and cross-platform too - and Andengine is great if you're happy to be stuck on Android!

如果您确实想要更高级的东西,Corona 非常体面且易于学习且跨平台 - 如果您乐于使用 Android,Andengine 非常棒!

回答by Risdecs

Yes, Angry Birds was developed on its own 2D engine. I recommend to look at these engines:

是的,《愤怒的小鸟》是在自己的 2D 引擎上开发的。我建议看看这些引擎:

Corona SDK - really simple crossplatform(!) engine. Nice one to start.

Corona SDK - 非常简单的跨平台(!)引擎。很好的开始。

AndEngine - havent any type of documentation, but there are a lot of references and useful extensions, including Multiplayer. Good community

AndEngine - 没有任何类型的文档,但有很多参考资料和有用的扩展,包括多人游戏。好社区

Marmalade (AirPlay SDK) - really powerful, but complex engine. Many hits were made on it

Marmalade (AirPlay SDK) - 非常强大但复杂的引擎。很多点击它

Also you can use Unity3D with 2D extension. Its awesome engine.

您也可以将 Unity3D 与 2D 扩展一起使用。它很棒的引擎。

Good luck with your beginnings ;)

祝你开始好运;)

回答by Karthi

Persnally, To Get started with your first 2D game, Don't straight away start with a Game Engine or 2D Frameworks.

Persnally,要开始您的第一个 2D 游戏,不要立即开始使用游戏引擎或 2D 框架。

Here's a Game that I developed with just the bitmap manipulation logic and a java thread to run the game.

这是我仅使用位图操作逻辑和运行游戏的 Java 线程开发的游戏。

Parachute Penguins

降落伞企鹅

https://play.google.com/store/apps/details?id=com.positivesthinking.parachutepenguinsfree

https://play.google.com/store/apps/details?id=com.positivesthinking.parachutepenguinsfree

  1. Create a Java thread that serves as a game loop.
  2. Make use of SurfaceView and manipulate bitmaps and with onClickListeners you can achieve a simple 2D game.
  1. 创建一个用作游戏循环的 Java 线程。
  2. 利用 SurfaceView 和操作位图,使用 onClickListeners 可以实现简单的 2D 游戏。

Go for Game Engine and Frameworks once you are comfortable with it.

一旦你对它感到满意,就去使用游戏引擎和框架。

回答by Adnan Zahid

I'd recommend AndEngine. They have a really good forum plus their example code is pretty much self explanatory.

我会推荐AndEngine。他们有一个非常好的论坛,而且他们的示例代码几乎不言自明。

If you're looking for a headstart, follow this tutorial.

如果您正在寻找先机,请按照本教程进行操作

Go for AndEngine!

去 AndEngine!

回答by Wildroid

I already answered similar question in another post: Android 2D game development without an engine

我已经在另一篇文章中回答了类似的问题:Android 2D game development without an engine

I posted a tutorial at http://www.youtube.com/watch?v=PnnHGCKrIzw

我在http://www.youtube.com/watch?v=PnnHGCKrIzw 上发布了一个教程

Assuming that you are familiar with Java, Eclipse (or similar compiler), Google API, etc. Here are the steps to build a full-blown 2D Android game:

假设您熟悉 Java、Eclipse(或类似编译器)、Google API 等。以下是构建完整 2D Android 游戏的步骤:

  1. Use drawable-nodpi for sprite images (gives sprite size consistency across screen densities and sizes)

  2. Use different layouts to support various screen sizes (e.g. layout-large, layout-xlarge, etc...)

  3. Use TranslateAnimation and ObjectAnimator to animate sprite movements across screen

  4. Use math to figure out sprites collision (e.g. screen coordinates and sprite location etc.)

  5. Use handlers and condition statements to control the game events

  1. 将 drawable-nodpi 用于精灵图像(在屏幕密度和大小之间提供精灵大小的一致性)

  2. 使用不同的布局来支持各种屏幕尺寸(例如 layout-large、layout-xlarge 等...)

  3. 使用 TranslateAnimation 和 ObjectAnimator 为屏幕上的精灵运动设置动画

  4. 使用数学计算精灵碰撞(例如屏幕坐标和精灵位置等)

  5. 使用处理程序和条件语句来控制游戏事件

You can test the outcome of following the above guide to developing a 2D Android game by checking out the game Yum Yum Pow available on Google Play. The free limited version is available also on Google Play and can be downloaded at:

您可以通过查看 Google Play 上提供的游戏 Yum Yum Pow 来测试遵循上述指南来开发 2D Android 游戏的结果。免费的有限版本也可在 Google Play 上下载,可从以下网址下载:

https://play.google.com/store/apps/details?id=com.wildroid.yum.yum.pow.limited

https://play.google.com/store/apps/details?id=com.wildroid.yum.yum.pow.limited

回答by Alex Huber

Felgo(felgo.com) offers several tutorials for any skill level. It's a cross-platform 2D game engine. There is already an open-source Angry Birdsclone that was made with Felgo. It also also comes with ready-to-use game templates for the most successful game genres like tower defense, platform games or puzzle games and provides reusable components for handling multiple display resolutions & aspect ratios, animations, particles, physics, multi-touch, gestures, pathfinding and more to prototype and build games within days API reference.

Felgo(felgo.com) 为任何技能水平提供了几个教程。它是一个跨平台的 2D 游戏引擎。已经有一个开源的 Angry Birds克隆版是用 Felgo 制作的。它还为塔防、平台游戏或益智游戏等最成功的游戏类型提供现成的游戏模板,并提供可重复使用的组件来处理多种显示分辨率和纵横比、动画、粒子、物理、多点触控、手势、寻路等功能,可在数天内API 参考进行原型设计和构建游戏 。

回答by bunbun

It is all well documented!

这一切都有据可查!

Try here, this helped me loads: http://www.javacodegeeks.com/2011/06/android-game-development-tutorials.html

在这里试试,这帮助我加载:http: //www.javacodegeeks.com/2011/06/android-game-development-tutorials.html