Is there a function whereby I can provide co-ordinates (x,y) and retrieve whether or not a graphic or a bitmap exists at that coordinate on the view?

I am creating the game 'breakout' on android.

I have an array of bricks objects (that have their x/y positions) and a ball object (with its x/y position). I need to check if they collided.

有帮助吗?

解决方案

Don't compare the bitmap as the background of every View is an image.

Instead, compare the x/y coordinates in your Brick / Ball Objects and determine if there is a collision based on those values.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top