8
« on: April 09, 2010, 02:07:04 PM »
For clarification purposes:
The Minesweeper clone is set on a roof. The shingles are the tiles and the "mines" are loose shingles that break/fall if clicked.
To make things difficult, the perspective is not flat, that means the tiles/shingles are not all the same size. Instead, each shingle is pretty much its own graphic and they are NOT interchangable.
I use 132 shingle-entities. Because they're not interchangable, each one has its own sprite, so there are 132 pngs. Each one gets highlighted (Shingle.AlphaColor = ...) when the cursor hovers above it and each one gets darkened, if clicked and it's "safe". Each one is removable if it's a "mine" and clicked on. So each shingle has 4 possible states (normal, highlight, darkened, gone).
On top of that are the 132 number overlays. Each number is a graphic and set as the overlay entity's sprite. The graphics are interchangable, so in total there are just 9 pngs for that (1..8, marked). But their position is not interchangable, because of the non-flat perspective. The numbers are centered on the shingle and for shingles "closer" to the viewer that means different x,y offsets than for shingles further away. Since Wintermute doesn't properly support Entity.Width, it cannot be calculated dynamically.
(To better illustrate that: A small shingle in the back might be 30x32 pixels, so it's center has offsets of 15 and 16. A larger tile in the front might be 64x70, so the offset would be 32x35)
I can't mail you a repro project because I wouldn't know how to do one in reasonable time and I'm afraid my employer won't let me mail you the real project (although it's not commercial...).