Skip to main content
gamedev.net
🔒 Locked

Question about Tilewalker!

Started by Spyder 2 replies 200+ views
Original Post
Spyder
Spyder
hi i''ve read Isometric Game Programming with DirectX 7.0, but there is one thing i don''t understand. When I move the main character (that controls the scrolling) why can''t he simply move N, NE etc. According to the book I should move like this to go north: one square to the east and two squares to the northwest! Why can''t i simply just go north-west!? It''s the same for all the other directions, why take the long way around? I don''t get it....
Steven
Steven
What page are you getting this from? I''ve got a copy of the book (Great book, I bought it and put it on my shelf and have not read it yet!) and I might be able to help clarafly anything you do not understand.

When I find my code in tons of trouble,
Friends and colleages come to me,
Speaking words of wisdom:
"Write in C."
When I find my code in tons of trouble,Friends and colleages come to me,Speaking words of wisdom:"Write in C."My Web Site
Spyder
Spyder
Thanks for trying to help...
I am referring to pages 314-318
RapidStunna
RapidStunna
It''s not that he can''t literaly move north because he can. The point is that the author is saying if you are moving on a tile-by-tile basis and you want to move north, finding out where that tile is in the tile array is difficult because the tiles are stored diagonaly. And the basis function are east,southeast,west,and northwest. This means that in order to move in the array southeast, you increase your y position by 1. However in order to move north on a diagonal map, you need to know how to get there. So the author shows what the net change is by adding up the movement costs needed to get there. No matter what path you take to go north, the net change will always add to up be the same. So the author isn''t literaly saying go one east and two northwest. He is saying that in order to move north one tile in the tile array whether it be your main character or something else, you need to really move 1 with the x and -2 with the y. That will bring you north one square in the array. He has the exact net changes for all directions on page 319. I recommend you reread the section until it makes more sense.

---
My Site-My Tetris Clone w/Source
Come join us on IRC in #directxdev @ irc.afternet.org

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.