Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

How do I draw rectangles efficiently?

I am making a game where a ball is tilted and the player must get to the other side to get to the next level. I am going to insert rectangles as obstacles and I was wondering how I would draw them so they scale to most devices well and where I could
see exactly where they will go because I am going to be drawing ALOT of them and I am unfamiliar with the coordinate system when the phone is in landscape mode. Is there anyway to manually draw them in in the Design window of the layout file and the code would fill in itself? How would I detect ball collisions with the drawn rectangles? I really want to find a way around hard-coding each level with rectangles because that will take FOREVER and the pixels to different devices vary.

Thank you for answering!!!