我将如何做到这一点?(Android的捶一个痣) [英] How would I do this?(Android Whack-A-Mole)

查看:169
本文介绍了我将如何做到这一点?(Android的捶一个痣)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做一个简单的捶一个痣游戏,因为我的第一个小型项目为Android。我不知道如何去这一点。我知道和设置等一切的基础知识,但我不知道如何制作动画的痣和让这个当摩尔在里面可以挖掘向上的位置和角度会算。我知道我可以做一个图像按钮,有一个柜台上去了(柜台++),但我需要能够从摩尔在孔切换帧的摩尔向上的位置。有人告诉我,使用类型可绘制叫做选择或某种XML的动画,但我不能完全明白如何去做。如果任何人都可以向我提供某种形式的一个例子,我会很感激,如果有人能在正确的方向指向我。谢谢!

I'm making a simple whack-a-mole game as my first mini-project for android. I'm not sure how to go about this. I know the basics of setting everything up and such but I'm not sure how to animate the moles and make it so that when the mole is in the up position it can be tapped and a point will be counted. I know I can do an image button and have a counter go up(counter++) but I need to be able to switch frames from the mole in the hole to the mole in the up position. I've been told to use a type of drawable called a selector or some sort of xml animation but I can't quite understand how to do it. If anyone could provide me with an example of some sort I'd be grateful, or if somebody could point me in the right direction. Thanks!

推荐答案

使用一个游戏引擎。两种最流行的(在我看来)发动机 AndEngine 并的 libGDX 。前者更适合于初学者,是一个完整的发动机,而后者更是一个框架的中高级开发人员。

Use a game engine. The two most popular (in my opinion) engines are AndEngine and LibGDX. The former is geared more towards beginners and is a complete engine whereas the latter is more of a framework for intermediate to advanced developers.

这篇关于我将如何做到这一点?(Android的捶一个痣)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆