0

basically I am trying to make a side scrolling game, with an an Image button, the reason why I am using the image button is because when the image of the person is clicked it double jumps, when the background is clicked, it jumps. but, I am getting a problem when trying to convert an imagebutton into an integer, how would I go about doing this? or is there a better way of doing things such as double clicking the background for a double jump ect.?

4

1 回答 1

1

There are much, much better ways to go about this. It would take a lot of unnecessary work to get your implementation to work correctly. What you want to do is draw an image on a Canvas and check touch events and see if they happened in the boundary of that image.

Look here: http://www.javacodegeeks.com/2011/07/android-game-development-displaying.html

于 2012-08-10T20:48:34.227 回答