cdrake
08-29-2004, 07:27 PM
The code works when it is just for 1 pereson. But when I try to have it for 2 people only one of them will work.
This is what I am using to try and get the 2 guys to move.
life2 = 1;
life = 1;
gravity = 0.9;
fall = 0.4;
xpos = 0;
_root.onEnterFrame = function() {
if (Key.isDown(65)) {
balloon2.play();
xpos = xpos-1;
balloon2._xscale = 220;
} else if (Key.isDown(68)) {
balloon2.play();
xpos = xpos+1;
balloon2._xscale = -220;
}
if (Key.isDown(87)) {
balloon2.play();
up = true;
fall = fall-0.9;
gravity = 0.3;
} else {
up = false;
}
balloon2._y = balloon2._y+fall;
balloon2._x = balloon2._x+xpos;
gravity = gravity*1.01;
fall = fall+gravity;
};
_root.onEnterFrame = function() {
if (Key.isDown(Key.LEFT)) {
balloon.play();
xpos = xpos-1;
balloon._xscale = 220;
} else if (Key.isDown(Key.RIGHT)) {
balloon.play();
xpos = xpos+1;
balloon._xscale = -220;
}
if (Key.isDown(Key.UP)) {
balloon.play();
up = true;
fall = fall-0.9;
gravity = 0.3;
} else {
up = false;
}
balloon._y = balloon._y+fall;
balloon._x = balloon._x+xpos;
gravity = gravity*1.01;
fall = fall+gravity;
};
stop();
This is what I am using to try and get the 2 guys to move.
life2 = 1;
life = 1;
gravity = 0.9;
fall = 0.4;
xpos = 0;
_root.onEnterFrame = function() {
if (Key.isDown(65)) {
balloon2.play();
xpos = xpos-1;
balloon2._xscale = 220;
} else if (Key.isDown(68)) {
balloon2.play();
xpos = xpos+1;
balloon2._xscale = -220;
}
if (Key.isDown(87)) {
balloon2.play();
up = true;
fall = fall-0.9;
gravity = 0.3;
} else {
up = false;
}
balloon2._y = balloon2._y+fall;
balloon2._x = balloon2._x+xpos;
gravity = gravity*1.01;
fall = fall+gravity;
};
_root.onEnterFrame = function() {
if (Key.isDown(Key.LEFT)) {
balloon.play();
xpos = xpos-1;
balloon._xscale = 220;
} else if (Key.isDown(Key.RIGHT)) {
balloon.play();
xpos = xpos+1;
balloon._xscale = -220;
}
if (Key.isDown(Key.UP)) {
balloon.play();
up = true;
fall = fall-0.9;
gravity = 0.3;
} else {
up = false;
}
balloon._y = balloon._y+fall;
balloon._x = balloon._x+xpos;
gravity = gravity*1.01;
fall = fall+gravity;
};
stop();