Combined Code
movieClip 16 Walking_Back {
frame 1 {
_root.step2.start();
}
frame 5 {
_root.step1.start();
}
}
movieClip 17 Walking {
frame 3 {
_root.step1.start();
}
frame 7 {
_root.step2.start();
}
}
movieClip 26 Pizza_Idle {
}
movieClip 35 {
}
movieClip 51 {
}
movieClip 56 Attacking {
}
movieClip 57 Pizza_Girl {
}
// unknown tag 88 length 49
movieClip 64 Tutorial {
frame 7 {
_root.beepbeep.start();
}
}
movieClip 65 Tutorial_Rollout {
frame 140 {
stop();
_root.beepbeep.stop('beepbeep');
delete _root.beepbeep;
Tutorial_Instance.unloadMovie();
this.unloadMovie();
}
}
movieClip 68 Shadow_MC {
}
movieClip 71 {
}
movieClip 72 puff_mc {
frame 6 {
removeMovieClip(this);
}
}
movieClip 81 Vo_Idle {
}
movieClip 96 Vo_Idle2 {
}
movieClip 105 Vo_Idle3 {
}
movieClip 106 Vo_mc {
}
// unknown tag 88 length 49
movieClip 113 background {
}
movieClip 125 {
}
movieClip 126 Shield_MC {
frame 13 {
removeMovieClip(this);
}
}
movieClip 131 Mute_Button_MC {
frame 1 {
stop();
_root.allsounds.setVolume(100);
this.onPress = function () {
gotoAndStop('Down');
};
}
frame 2 {
stop();
_root.allsounds.setVolume(0);
this.onPress = function () {
gotoAndStop('Up');
};
}
}
frame 1 {
function StopStepSounds() {
_root.step1.stop();
_root.step2.stop();
}
function JumpCooldownCallback() {
bIsJumpReady = true;
clearInterval(jumpTimerID);
}
function Attack() {
if (bIsAttackReady) {
if (!bIsAttacking && !bIsJumping) {
bIsAttackReady = false;
timerID = setInterval(LiftCooldown, attackSpeed);
Pizza_Girl_Main.gotoAndStop(6);
if (Vo_Main.hitTest(Pizza_Girl_Main._x + 50, Pizza_Girl_Main._y, false)) {
VoHit();
}
bIsAttacking = true;
}
}
}
function LiftCooldown() {
bIsAttackReady = true;
clearInterval(timerID);
}
function spawnVo() {
vo = _root.attachMovie('Vo_mc', 'Vo_instance', 6);
vo._xscale = -100;
vo._x = 688;
vo._y = 350.95;
vo.gotoAndStop('Idle');
return vo;
}
function spawnPizzaGirl() {
pizza_girl = _root.attachMovie('Pizza_Girl', 'Pizza_Girl_Main', 7);
pizza_girl._x = 193;
pizza_girl._y = 363.95;
pizza_girl.gotoAndStop(1);
return pizza_girl;
}
function makePuff(x, y, x_scale, yscale) {
puff = _root.attachMovie('puff_mc', 'puffinstance', 5);
puff._x = x;
puff._y = y;
puff._xscale = x_scale;
puff._yscale = y_scale;
puff.play();
}
function makeShadow(x, y, depth) {
shadowfx = _root.attachMovie('Shadow_MC', 'shadowfx' + depth, depth);
shadowfx._x = x;
shadowfx._y = y;
return shadowfx;
}
function createTutorial() {
rollout = _root.attachMovie('Tutorial_Rollout', 'rollout_instance', 2);
rollout._x = 595.9500000000001;
rollout._y = 57;
}
function VoHit() {
VoStunTimer = setInterval(VoStunCallback, 150);
VoStunned = true;
Pizza_Girl_Main._x -= 5;
Vo_Health -= 25;
_root.thunk.start();
if (Vo_Health % 100 == 0) {
drawArmorCrush(Vo_Main._x - 100, Vo_Main._y - 200);
armorbreak.start();
}
}
function VoStunCallback() {
clearInterval(VoStunTimer);
VoStunned = false;
}
function drawBackground() {
bg = _root.attachMovie('background', 'background_instance', 1);
bg._x = 149;
bg._y = 111;
}
function drawArmorCrush(x, y) {
armorCrush = _root.attachMovie('Shield_MC', 'shieldinstance', 12);
armorCrush._x = x;
armorCrush._y = y;
armorCrush.play();
}
function drawMuteButton(x, y) {
muteButton_MC = _root.attachMovie('Mute_Button_MC', 'mutebutton', 20);
muteButton_MC._x = x;
muteButton_MC._y = y;
return muteButton_MC;
}
var bIsJumping = false;
var yVelocityStart = -60;
var yGravity = 10;
var yVelocityCurrent = yVelocityStart;
var Pizza_Girl_Starting_YPos = 0;
var JumpX = 0;
var JumpX_Power = 15;
var bIsCrouching = false;
var bIsJumpReady = true;
var jumpTimerID = 0;
var bIsAttacking = false;
var attackFrames = 1;
var ATTACK_FRAMES_MAX = 2;
var bIsAttackReady = true;
var timerID = 0;
var attackSpeed = 200;
var VoStunned = false;
var VoStunTimer = 0;
var Vo_Health = 400;
Vo_Main = 0;
Vo_Shadow = 0;
Pizza_Girl_Main = 0;
Pizza_Girl_Main_Shadow = 0;
this.onLoad = function () {
drawBackground();
Vo_Main = spawnVo();
Vo_Shadow = makeShadow(Vo_Main._x - 20, Vo_Main._y + 185, 4);
Pizza_Girl_Main = spawnPizzaGirl();
Pizza_Girl_Starting_YPos = Pizza_Girl_Main._y;
Pizza_Girl_Main_Shadow = makeShadow(Pizza_Girl_Main._x - 25, Pizza_Girl_Starting_YPos + 175, 3);
_root.allsounds = new Sound();
_root.step1 = new Sound(Pizza_Girl_Main);
_root.step1.attachSound('step1');
_root.step2 = new Sound(Pizza_Girl_Main);
_root.step2.attachSound('step2');
_root.beepbeep = new Sound();
_root.beepbeep.attachSound('beepbeep');
_root.beepbeep.setVolume(75);
_root.bgmusic = new Sound(this);
_root.thunk = new Sound(Pizza_Girl_Main);
_root.thunk.attachSound('thunk');
_root.armorbreak = new Sound(Vo_Main);
_root.armorbreak.attachSound('armorbreak');
_root.bgmusic.attachSound('bgmusic');
_root.bgmusic.start(0, 999);
createTutorial();
drawMuteButton(25, 25);
};
this.onEnterFrame = function () {
Pizza_Girl_Main_Shadow._x = Pizza_Girl_Main._x - 25;
Vo_Shadow._x = Vo_Main._x - 20;
if (VoStunned) {
if (Vo_Health > 300) {
Vo_Main.gotoAndStop('Hit1');
} else {
if (Vo_Health <= 300 && Vo_Health > 200) {
Vo_Main.gotoAndStop('Hit2');
} else {
if (Vo_Health <= 200 && Vo_Health > 100) {
Vo_Main.gotoAndStop('Hit3');
} else {
Vo_Main.gotoAndStop('Hit3');
}
}
}
} else {
if (Vo_Health > 300) {
Vo_Main.gotoAndStop('Idle');
} else {
if (Vo_Health <= 300 && Vo_Health > 200) {
Vo_Main.gotoAndStop('Idle2');
} else {
if (Vo_Health <= 200 && Vo_Health > 100) {
Vo_Main.gotoAndStop('Idle3');
} else {
Vo_Main.gotoAndStop('Idle3');
}
}
}
}
if (bIsAttacking) {
if (attackFrames == ATTACK_FRAMES_MAX) {
bIsAttacking = false;
attackFrames = 1;
} else {
Pizza_Girl_Main.gotoAndStop(6);
++attackFrames;
}
}
if (bIsJumping) {
Pizza_Girl_Main.gotoAndStop(5);
if (Pizza_Girl_Main._y <= Pizza_Girl_Starting_YPos && Pizza_Girl_Main._y + yVelocityCurrent < Pizza_Girl_Starting_YPos) {
yVelocityCurrent += yGravity;
Pizza_Girl_Main_Shadow._xscale += yVelocityCurrent / 4;
Pizza_Girl_Main_Shadow._yscale += yVelocityCurrent / 4;
Pizza_Girl_Main._y += yVelocityCurrent;
Pizza_Girl_Main._x += JumpX * JumpX_Power;
} else {
Pizza_Girl_Main._y = Pizza_Girl_Starting_YPos;
yVelocityCurrent = yVelocityStart;
JumpX = 0;
bIsJumping = false;
makePuff(Pizza_Girl_Main._x - 25, Pizza_Girl_Main._y + 170, 100, 100);
jumpTimerID = setInterval(JumpCooldownCallback, 100);
bIsJumpReady = false;
}
} else {
if (Key.isDown(39)) {
if (!bIsJumping && !bIsAttacking) {
if (Key.isDown(38) && bIsJumpReady) {
StopStepSounds();
JumpX = 1;
bIsJumping = true;
Pizza_Girl_Main._y = Pizza_Girl_Main_Starting_YPos + 0.01;
}
if (Key.isDown(90) && bIsAttackReady) {
Attack();
return undefined;
}
Pizza_Girl_Main._x += 15;
Pizza_Girl_Main.gotoAndStop(2);
}
} else {
if (Key.isDown(37)) {
if (!bIsJumping && !bIsAttacking) {
if (Key.isDown(38) && bIsJumpReady) {
StopStepSounds();
JumpX = -1;
bIsJumping = true;
Pizza_Girl_Main._y = Pizza_Girl_Main_Starting_YPos + 0.01;
}
if (Key.isDown(90) && bIsAttackReady) {
Attack();
return undefined;
}
Pizza_Girl_Main._x -= 15;
Pizza_Girl_Main.gotoAndStop(3);
}
} else {
if (Key.isDown(40)) {
if (!bIsJumping && !bIsAttacking) {
bIsCrouching = true;
Pizza_Girl_Main.gotoAndStop(4);
}
} else {
if (Key.isDown(38) && bIsJumpReady) {
if (!bIsJumping && !bIsAttacking) {
StopStepSounds();
if (Key.isDown(39)) {
JumpX = 1;
} else {
if (Key.isDown(37)) {
JumpX = -1;
}
}
bIsJumping = true;
Pizza_Girl_Main._y = Pizza_Girl_Main_Starting_YPos + 0.01;
}
} else {
if (Key.isDown(90) && bIsAttackReady) {
Attack();
} else {
if (!bIsAttacking) {
StopStepSounds();
Pizza_Girl_Main.gotoAndStop(1);
}
}
}
}
}
}
}
};
}