SpriteBatch a one-way road?
Posted: Thu Mar 28, 2013 8:37 pm
I'm working on a falling block game that uses triangle-shaped blocks. There are several colors of triangle blocks, and these are kept in a single image -- each color block is stored in its own quad. No animation is needed, because each block can be rotated into 1 of 2 positions -- pointing up or down.
When the game starts, one triangle (a quad) is randomly created, and once it hits the ground -- it is stored in the SpriteBatch, and herein lies my question: Once I've added it to the SpriteBatch, is there no way to pull out the (x, y), width, or height of that quad? I wanted to use what the SpriteBatch already contained for collision detection, but can't seem to find a way in to do that. Do I really need to duplicate the data in another structure so that I can iterate through it and check for collisions?
Thanks in advance! I'm new to Löve2D, but so far it's great and easy to adapt to coming from Microsoft's XNA platform.
Chris
When the game starts, one triangle (a quad) is randomly created, and once it hits the ground -- it is stored in the SpriteBatch, and herein lies my question: Once I've added it to the SpriteBatch, is there no way to pull out the (x, y), width, or height of that quad? I wanted to use what the SpriteBatch already contained for collision detection, but can't seem to find a way in to do that. Do I really need to duplicate the data in another structure so that I can iterate through it and check for collisions?
Thanks in advance! I'm new to Löve2D, but so far it's great and easy to adapt to coming from Microsoft's XNA platform.
Chris