Adobe, MAKE SOME NOISE

Isometrics …

March 18th, 2007

Playing all the angles
When I began I used tiles 100px by 50px. The benefit of this is that all my lines have a slope of ½ so they antialias quite nicely. The downside is that this screws all of my angles. In traditional orthogonal projection, all angles are multiples of 30°, however the 100x50 tiles give me angles somewhere close to 26½°. This will become a larger problem as I develop little geometric characters to roam around on my grid.

Failing the hit test.
The angles have been bugging me for a little while but my real brick wall right now is the hitTest method. My hope was to let characters roam around of their own accord and just worry about whether anyone was on a tile in any given situation. All of these assumptions hinged on the use of the hitTest method. I’ve put a dot on the stage that I'm using to test and it should be giving me a ‘hit’ only for the square it’s over. What I’m actually getting is a positive hit on the tile the dot is overlapping as well as any tile that shares a border with that one. In the screenshot below, all the white tiles are reporting hits...

hittest-issues

Isometrics continued

March 11th, 2007

The best laid plans
I’ve got a test case running perfectly. However I did have to alter my plans from yesterday for the ordering. To maintain the correct z-indexing, I generated each row in order, but the children of each row in reverse. Here’s a working sample, roll over each tile to see it’s position. The code generated the tiles in this order: [(0,3) (0,2) (0,1) (0,0)] [(1,3) (1,2) (1,1) (1,0)] ...

Isometrics – 01

March 10th, 2007

I’ve never worked with an isometric grid before so I’m shooting low. I’d like to knock together a simple iso field with some interactivity for testing. I just opened up Flash and TextMate and Im planning out two classes.

IsoGrid
Take grid dimensions (width, height)
Generate IsoBlocks
Place blocks

IsoBlock
Take block dimensions (width, height, depth(?))
Draw fill
Draw stroke
Know it’s own position (x,y)
Set mouseOver effects

Stumbling blocks already…

To prevent later aggrevation, I’ll say that the northwest face on each block is the ‘top’, and the northeast face will be ‘right.’ With that in mind, I can say that an IsoGrid(50, 100) would generate 50 blocks to the northeast, and 100 blocks to the southeast of the initial block.

iso_01

Additionally, since it’s a little odd to have each block’s origin at the top-left of the movieClip, I’ll modify my drawing method so I can keep the origin at the center of each block.

iso_02

Day: the first

March 9th, 2007

This space will be a collection of my ActionScript trials, successes, and (mostly) failures. I will use this space to document my code and processes. This site is for my own reference and tinkering, but if my work happens to help someone else out, so much the better.