How do I detect if a sprite was touched in Java libGDX?
问题 In the past few days I've been porting my game (Apopalypse) to the Android Mobile platform. I've did a quick search on Google of sprite touch detection but didn't find anything helpful. Each balloon will pop once touched and I just need to detect if it's touched. Here's my balloon spawning code: Rendering (x, y, width, and height are randomized): public void render() { y += 2; balloon.setX(x); balloon.setY(y); balloon.setSize(width, height); batch.begin(); balloon.draw(batch); batch.end(); }