0

I'm newbie in Android and i want start 2D game development. How to change image position? I try this:

  • OpenGL,but it's very complicated for me.I want anything easiser.
  • SetX,Margins,etc.I think this is not real way of development and this is slow.
  • I found some library/game engine for game development,but i don't want to use them.
  • I use animations,but it don't change real position...
4

2 回答 2

0

对于移动/导航的非常基本的图像,我认为您可以使用Animationandroid 提供的。在动画下,您有翻译功能,您可以使用它在任何方向翻译图像,只认为您需要处理坐标。下面是一个例如代码片段:

Animation animation = new TranslateAnimation(0, 500,0, 0);
animation.setDuration(1000);
animation.setFillAfter(true);
myImage.startAnimation(animation);
myImage.setVisibility(0);

有关更多详细信息,您可以访问以下帖子:

翻译动画

于 2013-08-12T08:23:02.397 回答
0

您可以使用libgdx,不像其他文档很容易获得,它为您提供了许多轻松开发游戏的功能。

于 2013-08-12T08:48:36.983 回答