I try to create my first game with game editor and there 's one thing that I want to know: can I make a door without using the LoadVars variable.
I don't want to use a lot of files.
Thank for answers
doorvar=1;
doornum=collide.cloneindex;
doorvar=0;
Actor*this;
int i;
int newdoornum;
if(doorvar==1){ //if player is touching a door
int i=doornum%2; //figure out even/odd door cloneindex
if(i==0){ //if door cloneindex is a multiple of 2 (0, 2, 4, 6, 8, etc etc)
newdoornum=doornum+1; } //then get next door (0 leads to 1, 2 leads to 3)
else { //if door is not multiple of 2
newdoornum=doornum-1;} //then get previous door (1 leads to 0, 3 leads to 2)
this=getclone2("door", newdoornum); //get the new door to warp to using getclone2
player.x=this->x;
player.y=this->y; //move to new door coordinates.
} //end if doorvar check.
Users browsing this forum: No registered users and 1 guest