x=view.x/2;
keys+=1; //add +1 to the keys variable
if(keys==5)
{
//open the door code
}
if(SCORE==5)
{
ChangeAnimation("door", "open", FORWARD); //open the door code
}
if(SCORE==5)
switch(doorstate)
{
case 0:
ChangeAnimation("Event Actor", "closed", FORWARD);
doorstate=1;
break;
case 1:
ChangeAnimation("Event Actor", "openwide", FORWARD);
doorstate=3;
break;
case 2:
ChangeAnimation("Event Actor", "door-01", FORWARD);
doorstate=3;
break;
}
if(doorstate==3)
{
LoadGame("level2.ged");
}
view.y+= view.height;
switch(cur_level)
{
case 0:
view.y=0;
break;
case 1:
view.y=800;
break;
// and so on
}
if(doorstate==2);
MoveTo("Event Actor", -350, -1800, 15, "tux", "walls");
{
switch(Cur_level)
{
case 0:
view.y=0;
directional_velocity=distance(x+200,y+550,tux.x,tux.y)/10; //Makes the view follow the Player.
x=min(max(x, -550), 3000); // Limits the view at the "x" position.
y=min(max(y, -400), -400); // Limits the view at the "y" position.
break;
case 1:
view.y=1000;
directional_velocity=distance(x+200,y+550,tux.x,tux.y)/10; //Makes the view follow the Player.
x=min(max(x, -550), +3000); // Limits the view at the "x" position.
y=min(max(y, -1500), -1500); // Limits the view at the "y" position.
break;
// and so on
}
}
if(Cur_level==0);
{
switch(Cur_level)
{
case 0:
view.y=0;
angle=direction(x+200,y+550,tux.x,tux.y);
directional_velocity=distance(x+200,y+550,tux.x,tux.y)/10; //Makes the view follow the Player.
x=min(max(x, -550), 3000); // Limits the view at the "x" position.
y=min(max(y, -400), -400); // Limits the view at the "y" position.
break;
case 1:
view.y=1000;
angle=direction(x+200,y+550,tux.x,tux.y);
directional_velocity=distance(x+200,y+550,tux.x,tux.y)/10; //Makes the view follow the Player.
x=min(max(x, -550), +3000); // Limits the view at the "x" position.
y=min(max(y, -1500), -1500); // Limits the view at the "y" position.
break;
// and so on
}
}
if(var==0);
{
// this code always executes
}
if(SCORE==5)
switch(doorstate)
{
case 0:
ChangeAnimation("Event Actor", "closed", FORWARD);
doorstate=1;
case 1:
ChangeAnimation("Event Actor", "openwide", FORWARD);
doorstate=2;
}
if(doorstate==2)
switch(Cur_level)
{
case 0:
MoveTo("Event Actor", -0, -0, 15, "tux", "walls");
Cur_level=1;
case 1:
MoveTo("Event Actor", -1000, -1800, 15, "tux", "walls");
Cur_level=2;
}
if(condition)
{ // <-- you should always have these, it makes the code block well defined
// your switch
}
switch(var)
{
case 0:
x+=5;
// note no break statement
// therefore if case 0 runs, it will continue running into the next case statement
case 1:
x+=10;
break;
}
if(doorstate==2)
{
tux.y = 1000;
}
angle=direction(x+320,y+240,tux.x,tux.y);
directional_velocity=distance(x+320,y+240,tux.x,tux.y)/10; //Makes the view follow the Player.
x=min(max(x, -550), 8000); // Limits the view at the "x" position.
y=min(max(y, -520), -520); // Limits the view at the "y" position.
if(doorstate==2)
{
tux.y = 1000;
view.y+= view.height;
}
Users browsing this forum: Google [Bot] and 1 guest