Map Help
Author |
Message |
Zeppelin
|
Posted: Thu Jan 03, 2008 5:03 pm Post subject: Map Help |
|
|
Ok I'm making an RPG and I need help with the overworld map. I have a couple jpegs of the maps but I have two questions.
1) How do I make it that a character cannot walk on certain sections or go off the edge of the map?
2) How can I make some thing happen (eg. Teleport to a different map, make a cutscene play, open a shop menu, etc.) when a character walks onto a certain area of the map? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Clayton
|
Posted: Thu Jan 03, 2008 5:13 pm Post subject: RE:Map Help |
|
|
Hint: Collision Detection is your friend. |
|
|
|
|
|
Tony
|
Posted: Thu Jan 03, 2008 8:46 pm Post subject: RE:Map Help |
|
|
don't think of maps in terms of jpegs. In fact, forget them completely for a while. Set up a grid -- a 2D array where each cell holds information about its own terrain. This way if you are at position (x,y) and want to know if you are allowed to go to the right, you check if position (x+1, y) is a road.
Once you get that working, you can draw a jpeg on top for the style effect. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
|
|