Section 1
//MainTimeline (rji_fla.MainTimeline)
package rji_fla {
import flash.events.*;
import flash.display.*;
public dynamic class MainTimeline extends MovieClip {
public var gravity:Number;
public var level:Level;
public var jumped:Boolean;
public var velocity:Number;
public var player:Player;
public function MainTimeline(){
addFrameScript(0, frame1);
}
public function jump(_arg1:Event){
if (!jumped){
player.y = (player.y - 5);
velocity = -20;
jumped = true;
};
}
function frame1(){
velocity = 0;
jumped = false;
gravity = 1;
addEventListener(Event.ENTER_FRAME, control_hero);
stage.addEventListener(MouseEvent.CLICK, jump);
}
public function control_hero(_arg1:Event){
var _local2:int;
if ((player.x - 20) < mouseX){
player.x = (player.x + 5);
};
if ((player.x + 20) > mouseX){
player.x = (player.x - 5);
};
velocity = (velocity + gravity);
if (!level.hitTestPoint(player.x, player.y, true)){
player.y = (player.y + velocity);
};
if (velocity > 10){
velocity = 10;
};
_local2 = 0;
while (_local2 < 10) {
if (level.hitTestPoint(player.x, player.y, true)){
player.y--;
velocity = 0;
jumped = false;
};
_local2++;
};
}
}
}//package rji_fla
Section 2
//Level (Level)
package {
import flash.display.*;
public dynamic class Level extends MovieClip {
}
}//package
Section 3
//Player (Player)
package {
import flash.display.*;
public dynamic class Player extends MovieClip {
}
}//package