Section 1
//MainTimeline (as3engine_fla.MainTimeline)
package as3engine_fla {
import flash.events.*;
import flash.display.*;
import flash.ui.*;
public dynamic class MainTimeline extends MovieClip {
public var speeda:Number;
public var inair:Boolean;
public var turned:Number;
public var upPressed:Boolean;
public var nudge:groundFull;
public var jumping:Boolean;
public var jump:Boolean;
public var downPressed:Boolean;
public var yScrollSpeed:int;
public var gravity:Number;
public var speed:Number;
public var walkLeft:Boolean;
public var nudge2:groundFull;
public var ground:groundFull;
public var ground2:groundFull;
public var maxvel:Number;
public var walking:Boolean;
public var walkRight:Boolean;
public var jumpheight:Number;
public var player:playerFull;
public var xScrollSpeed:int;
public var bgobject1:Array;
public function MainTimeline(){
addFrameScript(0, frame1);
}
public function Gravity(_arg1){
player.y = (player.y + gravity);
}
public function keyDownHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.LEFT){
walkLeft = true;
trace("left pressed");
} else {
if (_arg1.keyCode == Keyboard.RIGHT){
walkRight = true;
trace("right pressed");
} else {
if (_arg1.keyCode == Keyboard.UP){
if (jumping == false){
jump = true;
};
trace("up pressed");
} else {
if (_arg1.keyCode == Keyboard.DOWN){
trace("down pressed");
};
};
};
};
}
public function Animation(_arg1){
if (jump == true){
jumping = true;
inair = true;
jump = false;
};
if (inair == true){
player.gotoAndStop("jump");
};
if (jumping == true){
player.y = (player.y - jumpheight);
};
if ((((walkRight == false)) && ((walkLeft == false)))){
walking = false;
};
if (walking == true){
player.play();
} else {
if ((((walking == false)) && ((inair == false)))){
player.gotoAndStop(1);
};
};
}
function frame1(){
walkLeft = false;
walkRight = false;
upPressed = false;
downPressed = false;
xScrollSpeed = 10;
yScrollSpeed = 10;
jumpheight = 15;
jump = false;
jumping = false;
inair = false;
walking = false;
speed = 2.5;
maxvel = 10;
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
ground = new groundFull();
addChild(ground);
ground2 = new groundFull();
addChild(ground2);
nudge = new groundFull();
addChild(nudge);
nudge2 = new groundFull();
addChild(nudge2);
nudge.alpha = 0;
nudge.x = 0;
nudge.y = 2;
nudge2.alpha = 0;
nudge2.x = 320;
nudge2.y = 2;
ground2.x = 320;
ground2.y = 0;
ground.x = 0;
ground.y = 0;
ground2.gotoAndStop(2);
ground.stop();
nudge.stop();
nudge2.gotoAndStop(2);
player = new playerFull();
addChild(player);
player.width = 25;
player.height = 25;
player.x = 25;
player.y = 200;
player.scaleX = 0.41;
stage.addEventListener(Event.ENTER_FRAME, WalkLeft);
stage.addEventListener(Event.ENTER_FRAME, WalkRight);
stage.addEventListener(Event.ENTER_FRAME, Animation);
gravity = 0;
bgobject1 = ["ground", "nudge", "player"];
stage.addEventListener(Event.ENTER_FRAME, Gravity);
stage.addEventListener(Event.ENTER_FRAME, Collisions);
speeda = speed;
turned = 10;
}
public function keyUpHandler(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == Keyboard.LEFT){
walkLeft = false;
trace("left released");
} else {
if (_arg1.keyCode == Keyboard.RIGHT){
walkRight = false;
trace("right released");
} else {
if (_arg1.keyCode == Keyboard.UP){
trace("up released");
} else {
if (_arg1.keyCode == Keyboard.DOWN){
trace("down released");
};
};
};
};
}
public function WalkLeft(_arg1){
if (walkLeft == true){
walking = true;
player.scaleX = -0.41;
player.x = (player.x - speed);
} else {
if (walkLeft == false){
player.x = (player.x - 0);
};
};
}
public function Collisions(_arg1){
if (player.x > 100){
ground2.x = (ground2.x - speeda);
ground.x = (ground.x - speeda);
nudge.x = (nudge.x - speeda);
nudge2.x = (nudge2.x - speeda);
player.x = (player.x - speeda);
} else {
if (player.x < 50){
ground2.x = (ground2.x + speeda);
ground.x = (ground.x + speeda);
nudge.x = (nudge.x + speeda);
nudge2.x = (nudge2.x + speeda);
player.x = (player.x + speeda);
};
};
if (nudge2.hitTestPoint(player.x, player.y, true)){
player.y = (player.y - 5);
};
if (nudge.hitTestPoint(player.x, player.y, true)){
player.y = (player.y - 5);
};
if (ground2.hitTestPoint((player.x + 10), player.y, true)){
if (inair == true){
player.gotoAndStop(1);
jumping = false;
inair = false;
};
gravity = 0;
} else {
if (ground.hitTestPoint((player.x + 10), player.y, true)){
if (inair == true){
player.gotoAndStop(1);
jumping = false;
inair = false;
};
gravity = 0;
} else {
if (jumping == false){
if (gravity < maxvel){
gravity = (gravity + 1);
} else {
gravity = maxvel;
};
} else {
if (jumping == true){
if (gravity < (maxvel + jumpheight)){
gravity = (gravity + 1);
} else {
gravity = (maxvel + jumpheight);
};
};
};
};
};
}
public function WalkRight(_arg1){
if (ground2.x < -319){
ground2.nextFrame();
ground2.nextFrame();
nudge2.nextFrame();
nudge2.nextFrame();
nudge2.x = 320;
ground2.x = 320;
};
if (ground.x < -319){
ground.nextFrame();
ground.nextFrame();
nudge.nextFrame();
nudge.nextFrame();
nudge.x = 320;
ground.x = 320;
};
if (walkRight == true){
walking = true;
player.scaleX = 0.41;
player.x = (player.x + speed);
} else {
if (walkRight == false){
player.x = (player.x + 0);
};
};
}
}
}//package as3engine_fla
Section 2
//Symbol1_3 (as3engine_fla.Symbol1_3)
package as3engine_fla {
import flash.display.*;
public dynamic class Symbol1_3 extends MovieClip {
public function Symbol1_3(){
addFrameScript(0, frame1);
}
function frame1(){
alpha = 0;
}
}
}//package as3engine_fla
Section 3
//FireBall (FireBall)
package {
import flash.display.*;
public dynamic class FireBall extends MovieClip {
public function FireBall(){
addFrameScript(18, frame19);
}
function frame19(){
gotoAndPlay(3);
}
}
}//package
Section 4
//groundFull (groundFull)
package {
import flash.display.*;
public dynamic class groundFull extends MovieClip {
}
}//package
Section 5
//playerAttack (playerAttack)
package {
import flash.display.*;
public dynamic class playerAttack extends MovieClip {
}
}//package
Section 6
//playerFull (playerFull)
package {
import flash.display.*;
public dynamic class playerFull extends MovieClip {
public function playerFull(){
addFrameScript(11, frame12);
}
function frame12(){
gotoAndStop(2);
}
}
}//package
Section 7
//playerHurt (playerHurt)
package {
import flash.display.*;
public dynamic class playerHurt extends MovieClip {
}
}//package
Section 8
//playerJump (playerJump)
package {
import flash.display.*;
public dynamic class playerJump extends MovieClip {
}
}//package
Section 9
//playerStand (playerStand)
package {
import flash.display.*;
public dynamic class playerStand extends MovieClip {
}
}//package
Section 10
//playerStep (playerStep)
package {
import flash.display.*;
public dynamic class playerStep extends MovieClip {
}
}//package