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

Started by
1 comment, last by One-Winged Angel 22 years, 8 months ago
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
Advertisement
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~~
+<--->+With your feet in the air and your head on the groundTry this trick and spin it, yeahYour head will collapseBut there's nothing in it And you'll ask yourselfWhere is my mind+<--->+
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

This topic is closed to new replies.

Advertisement