Archived

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

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

This topic is 5968 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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