#### Archived

This topic is now archived and is closed to further replies.

# Flash Isometric Game Help!

This topic is 5935 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am currently making an isometric game in flash i have completed the map generator but i have hit a few stumps. One is that i cant add the avatar to the correct position on the board. It adds the character as if its a tilebased game. this is the code i used CharPos = [0,2]; if ( i == charPos[1] && j == charPos[0] ) { this.attachMovie("char", "char", (mapWidth*mapHeight+1) ); this.char._x = (j*tileW)+tileW/2; this.char._y = (i*tileH)+tileH/2; } Please help

##### Share on other sites
I think you''ve got your coordinate systems set up incorrectly. I''m assuming i and j mean "diagonal left top to right bottom" and "diagonal right top to left bottom", respectively. Right? (typical diamond map)

If so, you''ll have to set it up somehow like this:
x = (i - j) * tileW / 2 + offsetx
y = (i + j) * tileH / 2 + offsety

the offsets are constants for positioning your character in the middle of the tile, you''ll have to set that for every character. (use half the height and half the width of the character sprite for a first test)

If you meant something else or have a different coordinate system, you''ll have to go into more detail.

- JQ
Full Speed Games. Period.

??

##### Share on other sites
quote:
Original post by mortishroom
??

!

- JQ
Full Speed Games. Period.

1. 1
2. 2
3. 3
Rutin
12
4. 4
5. 5

• 26
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633695
• Total Posts
3013382
×