Jump to content
  • Advertisement

Archived

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

hooligan_

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!