I recently got into Android programming and want to make a simple game using a 2D canvas. I checked the Lunar Lander example and read some gestures, but it looks like I can only determine if the gesture has occurred. I want to make a slightly more sophisticated hit detection:
I want to create a simple game in which the user can drag a finger across one or more objects on the screen, and I want to be able to detect the objects that they moved in their path. They can start vertically, then horizontally, then vertically again, so that at the end of a continuous swipe they selected 4 elements.
1) Are there APIs that expose the functionality of getting the full path for a swipe? 2) Since I draw on canvas, I don’t think I can access things like “onMouseOver” for items in my game. Instead, I will have to find that the napkins were within the bounding box of my sprites. Am I thinking about it right?
If I missed an obvious post, I apologize. Thank you in advance!
source share