Archived

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

One-Winged Angel

2d RPG switch maps (scroll to a different screen)

Recommended Posts

I''m trying how to switch screens when a char gets to the side of a map, like the old NES Zelda. I think I got an Idea, but it''s not working yet. Its something like this: if( charposition = .....) { laodmap.... } The problem I''m having with this is that I use MS visual c++, and that idenifier is in a different file and its not letting me use it, (it is declared in a header file) I cant figure out the right way to tell it where the identifier is. I''m using Master SDK 2D game engine. If anyone can help me figure out how to do it, or what I''m doing wrong I would appericate it. Thanks, One-Winged Angel

Share this post


Link to post
Share on other sites
you should have charx and chary, which are the character''s x and y coordinates. you should check everytime when you recieve a arrow key input (ie the user wants to move the character) to see if the character will be moved off the map. if it will, then load new map. here''s an example:
//inside
switch(keydown)
{
case VKEY_UP:
if(chary + charspeed >= maxY)
newmapstuff(north);

break;

case VKEY_RIGHT:
if(charx + charspeed >= maxX)
newmapstuff(east);
break;
etc...
hope that helps!!
~~KaMiKaZ~~

Share this post


Link to post
Share on other sites
Thx for the help, I can figure out how to do it now, just that the guy who wrote the engine had an odd way of making the map (no x and y cord, just # on the tiles), but I think I got it figured out.
One-Winged Angel

Share this post


Link to post
Share on other sites