Need help with a tile based game please

Started by Corey, June 06, 2005, 10:26:48 AM

Previous topic - Next topic

Corey

Hey,
Im currently working on a tile based adventure game. I started out with the tile based game example from http://www.homestead.com/vbgames6/down2.html . It seemed to work well, and i made a few maps and worked on other parts of my code such as the character creation and so forth. However my problem is that i have more then one map so i have used multiple forms to switch from map to map. The problem I am encountering is that if I move from Form1 to Form3 it works, but if i move back to Form1 it loads the new map picture but the collision stays the same as the previous map.
IF anyone needs the actual code i am using, reply with an email adress, or use the one given in http://www.homestead.com/vbgames6/down2.html as it is virtually the same, except I am trying to go from one form to another
Thanks in advance,
Corey

golem

I don't quite understand what you mean by ' collision stays the same as the previous map'. Are you implying that it is displaying incorrectly (or the more likely you are not displaying the updated form based on actions on Form3).

If it is the latter, you are probably dealing you 'draw the image' routine is only being tripped by the form_load event. So when the form is first displayed, it works ok, but upon returning to the original form (which WILL NOT trip the form_load event) the change is not being reflected, (it would be in the same condition you left it in).

From a conceptual point of view you might want to think of it as follows:
 1) Your 'draw the image' routine needs to be a central routine.
 2) Your 'draw the image' decides what to render based on a shared data structure.
 3) You invoke that routine on form_load (already works. :) ), but you need to add other trigger events such as _resize, _gotfocus, etc. to suit as needed based on user  input.

Let me know if that helps. :)