Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Map Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Zeppelin




PostPosted: 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
Sponsor
sponsor
Clayton




PostPosted: Thu Jan 03, 2008 5:13 pm   Post subject: RE:Map Help

Hint: Collision Detection is your friend.
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: