i cant post fla. the site i usually use isnt working so this is my motion actionscript:
its on frame 1 scene 1 layer 1
var g = -20;
var scale:Number = 25;
var ex:Number = 2;
var grav:Number = 0;
var speed:Number = 10;
var jumpHeight:Number = 9;
player.vy = 0;
p1.vy = 0;
p2.vy = 0;
vx = 0;
vy = 0;
jump = 0;
radrot = 0;
player.gotoAndStop(2);
player.onEnterFrame = function() {
trace(vy);
radrot = player._rotation/57.2957795;
player._y += player.vy;
p1._y += p1.vy;
p2._y += p2.vy;
player.vy += g;
p1.vy += g;
p2.vy += g;
p1._x = player._x-24*Math.cos(radrot);
p1._y = player._y-24*Math.sin(radrot);
p2._x = player._x+24*Math.cos(radrot);
p2._y = player._y+24*Math.sin(radrot);
vx *= 0.75;
if (Key.isDown(Key.RIGHT)) {
player.gotoAndStop(1);
player._xscale = scale;
vx += 4*Math.cos(radrot);
player._y += 4*Math.sin(radrot);
} else if (Key.isDown(Key.LEFT)) {
player.gotoAndStop(1);
vx -= 4*Math.cos(radrot);
player._y -= 4*Math.sin(radrot);
player._xscale = -scale;
} else {
player.gotoAndStop(3);
}
if (Key.isDown(Key.UP)) {
//player.vy = -8;
}
if (!ground.hitTest(player._x, player._y, true)) {
g = 0.4;
}
while (ground.hitTest(player._x, player._y, true)) {
g = 0;
player.vy = 0;
player._y -= 0.1*Math.cos(radrot);
player._x += 0.1*Math.sin(radrot);
}
while ((!ground.hitTest(player._x, player._y, true)) && (ground.hitTest(player._x, player._y+8, true))) {
player._y += 0.1*Math.cos(radrot);
player._x -= 0.1*Math.sin(radrot);
}
while (ground.hitTest(p1._x, p1._y, true)) {
p1._y -= Math.cos(radrot);
p1._x += Math.sin(radrot);
trace("1"
;
if (p1._y<p2._y) {
angle = Math.atan2(p2._y-p1._y, p2._x-p1._x);
player._rotation = angle*(180/Math.PI);
} else {
angle = Math.atan2(p1._y-p2._y, p2._x-p1._x);
player._rotation = -angle*(180/Math.PI);
}
}
while (ground.hitTest(p2._x, p2._y, true)) {
p2._y -= Math.cos(radrot);
p2._x += Math.sin(radrot);
if (p1._y<p2._y) {
angle = Math.atan2(p2._y-p1._y, p2._x-p1._x);
player._rotation = angle*(180/Math.PI);
} else {
angle = Math.atan2(p1._y-p2._y, p2._x-p1._x);
player._rotation = -angle*(180/Math.PI);
}
}
while (!ground.hitTest(p1._x, p1._y, true)) {
p1._y += Math.sin(radrot+90);
p1._x += Math.cos(radrot+90);
if (p1._y<p2._y) {
angle = Math.atan2(p2._y-p1._y, p2._x-p1._x);
player._rotation = angle*(180/Math.PI);
} else {
angle = Math.atan2(p1._y-p2._y, p2._x-p1._x);
player._rotation = -angle*(180/Math.PI);
}
}
while (!ground.hitTest(p2._x, p2._y, true)) {
p2._y += Math.sin(radrot+90);
p2._x += Math.cos(radrot+90);
if (p1._y<p2._y) {
angle = Math.atan2(p2._y-p1._y, p2._x-p1._x);
player._rotation = angle*(180/Math.PI);
} else {
angle = Math.atan2(p1._y-p2._y, p2._x-p1._x);
player._rotation = -angle*(180/Math.PI);
}
}
if (p1._y != p2._y) {
ang = player._rotation/57.2957795;
ground._x -= vy*Math.sin(ang);
player._y += vy*Math.cos(ang);
ground._x -= vx*Math.cos(ang);
player._y += vx*Math.sin(ang);
} else if (p1._y == p2._y) {
player._y += vy;
ground._x -= vx;
}
};
“Didn’t we have some fun though? Remember when the platform was sliding into the fire pit and I said ‘Goodbye’ and you were like ‘NO WAY!’ and then I was all ‘We pretended we were going to murder you’? That was great."
Portal