Section 3

Our next problem to solve is knowing which arrow to use. We've already worked out the code to detect when we are over a Mirror Cell and when we are in the "inside" or "outside" click region.

We have a game design decision to make. For the two click-regions within a cell, which one will we use for moving and which one for rotation? I'm leaning toward the idea that when the user clicks in the outer region the user is attempting to rotate the cell. When clicking closer inside, towards the center of the cell, the user is attempting to push the cell. So there we have it. A click within the inside click-region will attempt to push the cell.

Here's our magnified click regions again with an example arrow if the user has hovered over that region of the cell on the "left side" of the bar".

What happens when the cursor is moved up and still within the inner click region?

We obviously need a way to detect when the user is over the correct portion of the inner click region. It doesn't matter which way the mirror leans. In this example the arrow should still point "south".

The inner click region needs to be futher subdivided into 4 triangles. One for each arrow or push direction.

Index Page Next Page

Copyright © 2007, 2008, 2009, 2010 Stephan B Wessels    stevewessels@me.com