OK, so you found this secret page with extra help for the Lunar
Lander Flash project. Here is some code that works - don't forget
to try to understand it though!vy = 0;
vx = 0;
_root.onEnterFrame = function() {
if (_root.lander1._y <_root.pad1._y) {
vy = vy + 0.1;
_root.lander1._y = _root.lander1._y + vy;
_root.lander1._x = _root.lander1._x + vx;
} else {
landerright = _root.lander1._x + _root.lander1._width;
padright = _root.pad1._x + _root.pad1._width;
if ((_root.lander1._x > _root.pad1._x) && (landerright < padright)) {
message = "The Eagle has landed";
} else {
message = "The Eagle just died";
}
}
}; |