Jump to content

  • Log In with Google      Sign In   
  • Create Account


jariRG

Member Since 22 Apr 2006
Offline Last Active Today, 07:14 PM
-----

Topics I've Started

Collapsing elements

13 April 2011 - 12:43 PM

Im currently working on a "bust a move" style game, but have no idea how to solve the collapsing elements problem.
The gamefield is represented as a simple 2D array, and no color matching rule right now (like in the mentioned game).
The main question, how can i check if a cell (or a groups of cells) is separated from the others?

I made a picture:
Posted Image
Here, i marked the separated cell group that i need to remove.
Is there any general algorithm that can solve this problem?

D3DXSprite position

25 February 2011 - 05:47 PM

Im trying to get the position (_41, _42) from the constructed matrix (D3DXMatrixTransformation2D). The main problem is, when rotation is not 0, the position from matrix is rotated too. The rotation center is set to half size of texture (rectangle), and it doesn't seems to rotate position around this RotationCenter point. If the rotation value is 0, then the position vector from matrix is exactly what it should be.
It's a hierarchical system, so i cant just use the Position what set by the user, i must reconstruct after D3DXSprite's SetTransform call.

Why rotates the Position? Or how can i restore the correct position value?

EDIT: I forgot to mention, the sprite is rendered the correct position to the screen!

PARTNERS