My game is going to be something like Super Mario Bros 2. I was wondering how do I make doors in my game to get to different places?
Thanks
x = 344;
y = -321; // these coordinates are just random, enter the exact x and y position, just right where you want your actor to go. Make sure the view stays with it.
// I make the assumption that 12 doors will be lots
double DoorX[12];
double DoorY[12];
// this will store the location of each door clone, up to number 12. It makes 2 arrays
DoorX[cloneindex]=x;
DoorY[cloneindex]=y;
int DoorDest[12] = {6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4, 5, 6, 13};
// we are assuming that door zero leads to door six, door 1 leads to door 7 and that those doors lead back. Note the mysterious 13th door. It doesnt lead anywhere
// but arrays actually start counting at zero, so we should have used 11 in the arrays, But this shows the fact visually and that you can hide stuff in your game. Maybe
// door 13 is for the creator only!
// in door script during collision with player.
ChangeParent("Player", "view");
view.x = DoorX[DoorDest[cloneindex]];
view.y = DoorY[DoorDest[cloneindex]];
ChangeParent("Player", "(none)"); // or whatever it was before.
door=1;
door=0
if (door=1) moveTo (wherever the other door is)
Users browsing this forum: No registered users and 1 guest